Problem with Animated GIFs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Armin Zingler

    #16
    Re: Problem with Animated GIFs

    Try this:
    control panel -display: Folder "settings", button "advanced", folder
    "problem... ", reduce hardware acceleration to minimum. Accept.

    (maybe text's slightly differ; I don't have the English OS version)

    Does it make a difference?


    Armin

    Comment

    • Phil

      #17
      Re: Problem with Animated GIFs


      "Armin Zingler" <az.nospam@free net.dewrote in message
      news:%23OQzdxz3 HHA.1484@TK2MSF TNGP06.phx.gbl. ..
      Try this:
      control panel -display: Folder "settings", button "advanced", folder
      "problem... ", reduce hardware acceleration to minimum. Accept.
      >
      (maybe text's slightly differ; I don't have the English OS version)
      Control PanelDisplaySet tingsAdvancedTr oubleshooting
      >
      Does it make a difference?
      No. I set the acceleration to None, but it makes no difference.


      Comment

      • Armin Zingler

        #18
        Re: Problem with Animated GIFs

        "Phil" <N/Aschrieb
        >
        "Armin Zingler" <az.nospam@free net.dewrote in message
        news:%23OQzdxz3 HHA.1484@TK2MSF TNGP06.phx.gbl. ..
        Try this:
        control panel -display: Folder "settings", button "advanced",
        folder "problem... ", reduce hardware acceleration to minimum.
        Accept.

        (maybe text's slightly differ; I don't have the English OS
        version)
        >
        Control PanelDisplaySet tingsAdvancedTr oubleshooting

        Does it make a difference?
        >
        No. I set the acceleration to None, but it makes no difference.
        Hmmm.. Another attempt: Add a Timer (system.windows .forms.timer), set
        interval to 10. In it's tick event, call ThePicturebox.R efresh. Any
        difference?

        Try booting in safe mode. Difference?


        Armin

        Comment

        • Hoop

          #19
          Re: Problem with Animated GIFs

          On Aug 15, 3:13 am, "Phil" <N/Awrote:
          Hi,
          Can you use AxAnimation in Express? It would be in the Tools/Choose
          ToolBox items, and select the Com tab.
          >
          I have AXBrowse.AXBrow ser but not AXAnimation.
          Presumably this is something that is part of some other application and
          needs to be installed separately.
          >
          Thats what I am currently using. Also, there is a project in Code
          Project named .NET Animation Control that you can add, I have tried
          that also and it works. I do use .avi files though.
          >
          I would like to be able to use AVI files too, so I may check that out.
          >
          Thanks,
          Phil.
          Hi,
          In the ToolBox items, click the com tab and look for an item that you
          can named,
          Microsoft Animation Control 6.0(SP4). Placing that on your form will
          allow you to run
          animations. If you do not see that, click the browse and go to Windows/
          System32
          and look for a dll named mscomctl2, something like that, and adding it
          should give the amination
          control.
          Jeff

          Comment

          • Linda Liu [MSFT]

            #20
            Re: Problem with Animated GIFs

            Hi Phil,

            Sorry for my delayed reply!

            You have mentioned that you found a workaround to use WebBrowser to display
            the animated GIFs on a form. But the problems of this workaround are that
            it's difficult to change the back ground color of the WebBrowser control
            and load the animated GIFs from the application resources.

            I have done some research on these two problems, but unfortunately I didn't
            find a solution for them.

            In fact, animated GIF has stored timing interval information of each frame
            in the GIF file itself. We can retrieve it through the PropertyItems
            property of the Image class. Once we get this information, we could use a
            System.Windows. Forms.Timer component to control and display the animated
            GIF. The following is a sample, which requires you add a PictureBox on the
            form.

            Imports System.Drawing. Imaging
            Imports System.IO

            Public Class Form1

            Dim gif As Image = Image.FromFile( Application.Sta rtupPath &
            "\test1.gif ")

            Dim fcount As Integer = gif.GetFrameCou nt(FrameDimensi on.Time)
            Dim interval(fcount ) As Integer

            Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
            System.EventArg s) Handles MyBase.Load

            Dim item As PropertyItem = gif.GetProperty Item(20736)
            Dim index As Integer = 0

            For i As Integer = 0 To gif.GetFrameCou nt(FrameDimensi on.Time) - 1
            interval(i) = BitConverter.To Int32(item.Valu e, index)
            index += 4
            Next
            ShowGif()
            ' the timing interval storted in the GIF file is of the unit of
            centi-second
            Me.Timer1.Inter val = interval(findex ) * 10
            Me.Timer1.Start ()
            End Sub

            Dim findex As Integer = 0
            Private Sub Timer1_Tick(ByV al sender As Object, ByVal e As
            System.EventArg s) Handles Timer1.Tick
            findex += 1
            If (findex = fcount) Then
            findex = 0
            End If

            ShowGif()
            Me.Timer1.Inter val = interval(findex ) * 10

            End Sub

            Private Sub ShowGif()
            gif.SelectActiv eFrame(FrameDim ension.Time, findex)
            Me.PictureBox1. Invalidate()

            End Sub

            Private Sub PictureBox1_Pai nt(ByVal sender As Object, ByVal e As
            System.Windows. Forms.PaintEven tArgs) Handles PictureBox1.Pai nt
            e.Graphics.Draw Image(gif, New Point(0, 0))
            End Sub
            End Class

            I display the GIF you provided using the above code and the animation on
            the PictureBox is not slower than it is in IE.

            Please try my sample code out on your side and let me know the result.

            Sincerely,
            Linda Liu
            Microsoft Online Community Support

            Comment

            • Phil

              #21
              Re: Problem with Animated GIFs

              Thanks Linda, I'll give this a try and let you know if it helps.
              Cheers,
              Phil.

              "Linda Liu [MSFT]" <v-lliu@online.mic rosoft.comwrote in message
              news:avfSiYu4HH A.6140@TK2MSFTN GHUB02.phx.gbl. ..
              Hi Phil,
              >
              Sorry for my delayed reply!
              >
              You have mentioned that you found a workaround to use WebBrowser to
              display
              the animated GIFs on a form. But the problems of this workaround are that
              it's difficult to change the back ground color of the WebBrowser control
              and load the animated GIFs from the application resources.
              >
              I have done some research on these two problems, but unfortunately I
              didn't
              find a solution for them.
              >
              In fact, animated GIF has stored timing interval information of each frame
              in the GIF file itself. We can retrieve it through the PropertyItems
              property of the Image class. Once we get this information, we could use a
              System.Windows. Forms.Timer component to control and display the animated
              GIF. The following is a sample, which requires you add a PictureBox on the
              form.
              >
              Imports System.Drawing. Imaging
              Imports System.IO
              >
              Public Class Form1
              >
              Dim gif As Image = Image.FromFile( Application.Sta rtupPath &
              "\test1.gif ")
              >
              Dim fcount As Integer = gif.GetFrameCou nt(FrameDimensi on.Time)
              Dim interval(fcount ) As Integer
              >
              Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
              System.EventArg s) Handles MyBase.Load
              >
              Dim item As PropertyItem = gif.GetProperty Item(20736)
              Dim index As Integer = 0
              >
              For i As Integer = 0 To gif.GetFrameCou nt(FrameDimensi on.Time) - 1
              interval(i) = BitConverter.To Int32(item.Valu e, index)
              index += 4
              Next
              ShowGif()
              ' the timing interval storted in the GIF file is of the unit of
              centi-second
              Me.Timer1.Inter val = interval(findex ) * 10
              Me.Timer1.Start ()
              End Sub
              >
              Dim findex As Integer = 0
              Private Sub Timer1_Tick(ByV al sender As Object, ByVal e As
              System.EventArg s) Handles Timer1.Tick
              findex += 1
              If (findex = fcount) Then
              findex = 0
              End If
              >
              ShowGif()
              Me.Timer1.Inter val = interval(findex ) * 10
              >
              End Sub
              >
              Private Sub ShowGif()
              gif.SelectActiv eFrame(FrameDim ension.Time, findex)
              Me.PictureBox1. Invalidate()
              >
              End Sub
              >
              Private Sub PictureBox1_Pai nt(ByVal sender As Object, ByVal e As
              System.Windows. Forms.PaintEven tArgs) Handles PictureBox1.Pai nt
              e.Graphics.Draw Image(gif, New Point(0, 0))
              End Sub
              End Class
              >
              I display the GIF you provided using the above code and the animation on
              the PictureBox is not slower than it is in IE.
              >
              Please try my sample code out on your side and let me know the result.
              >
              Sincerely,
              Linda Liu
              Microsoft Online Community Support
              >

              Comment

              • Linda Liu [MSFT]

                #22
                Re: Problem with Animated GIFs

                Hi Phil,

                Have you tried my sample code out? How about the problem now?

                If the problem is still not solved, please feel free to let me know.

                Thank you for using our MSDN Managed Newsgroup Support Service!

                Sincerely,
                Linda Liu
                Microsoft Online Community Support

                Comment

                • Phil

                  #23
                  Re: Problem with Animated GIFs

                  >
                  Have you tried my sample code out?
                  >
                  Sorry, I have been away.
                  How about the problem now?
                  Yes, your code works very well The animated GIF displays correctly.

                  I added a second picture box and loaded the same image in normally, and it
                  is very clear that the default code in the picturebox control itself is
                  displaying the animation too slowly and is missing out frames. This would
                  definitely therefore appear to be a bug in the picturebox control, although
                  it is puzzling why other people don't see the same problem. I guess it must
                  be something to do with my hardware. If you'd like any extra information
                  about my PC set-up to help track down the error, please let me know.

                  Meanwhile I'll have a go at building your code into a new custom control,
                  that I can use in place of the picturebox whenever I need to display an
                  animated GIF.

                  Thanks,
                  Phil.



                  Comment

                  • Linda Liu [MSFT]

                    #24
                    Re: Problem with Animated GIFs

                    Hi Phil,

                    Thank you for your feedback! I am glad to hear that my code works on your
                    side.

                    I think also the problem may be specific to your hardware. You may have a
                    try on another PC to see if the problem still exists.

                    If convenience, please send me the information about your PC set-up and I
                    will record it in our internal database. It will definitely help to improve
                    our product. (To get my actual email, remove 'online' from my displayed
                    email address.)

                    We appreciate your contribution to our product!

                    Sincerely,
                    Linda Liu
                    Microsoft Online Community Support

                    Comment

                    • Phil

                      #25
                      Re: Problem with Animated GIFs

                      >
                      If convenience, please send me the information about your PC set-up and I
                      will record it in our internal database. It will definitely help to
                      improve
                      our product. (To get my actual email, remove 'online' from my displayed
                      email address.)
                      >
                      System:
                      Microsoft Windows XP
                      Professional
                      Version 2002
                      Service Pack 2

                      Computer:
                      AMD Sempron(tm) Processor
                      3000+
                      1.81 GHz, 512 MB of RAM
                      Physical Address Extension

                      Display Adapter:
                      WinFast PX6200 TC

                      Monitor:
                      Ergovision 975TCO95

                      Display Properties
                      Screen resolution 128x1024
                      Color quality Highest (32 bit)
                      Advanced:
                      Normal size (96 DPI)
                      Screen refresh rate 85 Hertz
                      There is also a GeForce 6200 TurboCache tab which displays further nVidia
                      settings. I'm not sure if any of these may be relevant.

                      HTH
                      Phil.


                      Comment

                      • rowe_newsgroups

                        #26
                        Re: Problem with Animated GIFs

                        Screen resolution 128x1024

                        Wow, that must be one narrow monitor.

                        :-)

                        Thanks,

                        Seth Rowe

                        Comment

                        • Phil

                          #27
                          Re: Problem with Animated GIFs


                          "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
                          news:1188556121 .670500.134000@ l22g2000prc.goo glegroups.com.. .
                          >Screen resolution 128x1024
                          >
                          Wow, that must be one narrow monitor.
                          oops, should have been 1280 not 128 :-)


                          Comment

                          • Linda Liu [MSFT]

                            #28
                            Re: Problem with Animated GIFs

                            Hi Phil,

                            Thank you for your reply!

                            I will record this information in our inner database.

                            If you have any other question in the future, please don't hesitate to
                            contact us. It's our pleasure to be of assistance!

                            Have a nice day!

                            Sincerely,
                            Linda Liu
                            Microsoft Online Community Support

                            Comment

                            Working...