473,608 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Animated GIFs

I thought it would be nice to display some animated GIFs on some of my
forms. I put a PictureBox control on a form, and loaded my GIF file in. It
animates, but not properly. It seems very jerky and dwells on some frames
longer than it should. Searching for this problem, I have found several
people who have stated that animated GIFs don't work in a PictureBox at all,
and you have to use the ImageAnimator. I assume they must be referring to an
older version, because I do get some animation, it's just not quite right. I
am using VB2005 Express.
I thought it might be a problem with running under the IDE, but I still get
the same problem if I build the project and run the release exe.
I looked up ImageAnimator in the help, and it is not especially helpful, but
there was some sample code. I tried this, and I get exactly the same
problem. The image displays and animates, but the timing seems all wrong. If
I use the image preview in Windows XP the image displays fine, so I don't
think it's a problem with the GIF file itself.
Any suggestions, greatly appreciated.
TIA
Phil.
Aug 13 '07 #1
27 13998
Phil,

You are sure that you set the properties of the picturebox right

By instance this ones let it look on every screen different

http://msdn2.microsoft.com/en-us/lib....sizemode.aspx

Cor

"Phil" <N/Aschreef in bericht news:13******** *****@corp.supe rnews.com...
>I thought it would be nice to display some animated GIFs on some of my
forms. I put a PictureBox control on a form, and loaded my GIF file in. It
animates, but not properly. It seems very jerky and dwells on some frames
longer than it should. Searching for this problem, I have found several
people who have stated that animated GIFs don't work in a PictureBox at
all, and you have to use the ImageAnimator. I assume they must be referring
to an older version, because I do get some animation, it's just not quite
right. I am using VB2005 Express.
I thought it might be a problem with running under the IDE, but I still
get the same problem if I build the project and run the release exe.
I looked up ImageAnimator in the help, and it is not especially helpful,
but there was some sample code. I tried this, and I get exactly the same
problem. The image displays and animates, but the timing seems all wrong.
If I use the image preview in Windows XP the image displays fine, so I
don't think it's a problem with the GIF file itself.
Any suggestions, greatly appreciated.
TIA
Phil.
Aug 13 '07 #2
Hi Phil,

Based on my understanding, you'd like to display some animated GIFs on some
of your forms. But you find that the animated GIF is slower when it is
displayed in a WinForm than in the image preview in the Windows Explorer.
If I'm off base, please feel free to let me know.

I performed some tests and did reproduce the problem. When I display an
animated GIF in a PictureBox on a WinForm, the animation is a little slower
than displayed in the Internet Explorer.

I guess WinForm limits the maximum frames displayed per second. I have
seached in our inner database, but unfortunately, I haven't found any
information about it so far.

I will consult this issue in our inner discussion group and as soon as I
get any news, I will get it back to you.

In addtion, although my animated GIF is displayed slower in a WinForm, but
the animation is smooth. As you have mentioned, the animated GIF you're
using seems jerky when it is display in a form. Could you please send me
the animated GIF? To get my actual email address, remove 'online' from my
displayed email address.

Thank you for your cooperation and patience!

Sincerely,
Linda Liu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 14 '07 #3

You are sure that you set the properties of the picturebox right

By instance this ones let it look on every screen different

http://msdn2.microsoft.com/en-us/lib....sizemode.aspx
I set SizeMode to AutoSize, but I'll try setting the size manually and see
if that makes any difference.
That wouldn't explain the problem when using ImageAnimator though, as in
that example it was drawing directly on the form.
Aug 14 '07 #4
>You are sure that you set the properties of the picturebox right
>>
By instance this ones let it look on every screen different

http://msdn2.microsoft.com/en-us/lib....sizemode.aspx
I set SizeMode to AutoSize, but I'll try setting the size manually and see
if that makes any difference.
I tried setting SizeMode to Normal, and it makes no difference.
Aug 14 '07 #5
Within the IDE or when running the program?
It makes no difference whether I run the program from within the IDE or
compile it, and run the exe.
In the IDE, I don't see any
animation at all.
I don't see any animation when using the form designer. That is not a
problem. I am only concerned with the runtime behaviour.
When running the program, it is displayed correctly.
Not for me :(
>(VB 2005 Express)
That is what I am using too.


Aug 14 '07 #6
"Phil" <N/Aschrieb
>
Within the IDE or when running the program?

It makes no difference whether I run the program from within the IDE
or compile it, and run the exe.
In the IDE, I don't see any
animation at all.

I don't see any animation when using the form designer. That is not
a problem. I am only concerned with the runtime behaviour.
When running the program, it is displayed correctly.

Not for me :(
(VB 2005 Express)

That is what I am using too.

What else does the application do? Does it do any other job while you are
watching the image? Maybe you are using System.Windows. Forms.Timer that does
things from time to time?

Have you already tried it in a new project?
Armin

Aug 14 '07 #7
What else does the application do?
Nothing yet. First thing I tried when it didn't work was to create a new
project to ensure nothing else might be interfering.

Aug 14 '07 #8
I tried calling UpdateFrames twice in my Paint event handler, and now it
is displaying the new frame correctly.
Actually that seemed to work once, but is now not working again. :-(
Aug 14 '07 #9

"Phil" <N/Awrote in message news:13******** *****@corp.supe rnews.com...
>I tried calling UpdateFrames twice in my Paint event handler, and now it
is displaying the new frame correctly.

Actually that seemed to work once, but is now not working again. :-(
What does seem to fix it though is calling
Threading.Threa d.Sleep(10)

before calling UpdateFrames.
Aug 14 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
308
by: MrPickwick | last post by:
Hi there. If I place a picturebox on my form and load (at design time) an animated gif into it, it shows and animates allright. If I load my animated gifs in an Imagelist at design time and at runtime copy the image from the list into a PictureBox using "MyPictureBox.Image = MyImageList.Images(n)" it will only show the first frame and not animate at all. Does this not work at all? Are there alternatives? Thanks and regards
0
1827
by: GrandpaB | last post by:
I am creating a small simulation in VB and wish to incorporate several animated GIFS. I can load the GIFS from the hard drive into a picture box and they animate, but I have two questions. 1.) Some of the GIFS were designed to play once, but in my VB application they loop continuously. What must I do to make them play only once? 2.) When I build the solution for distribution, how do I
2
2649
by: Dale Reed | last post by:
Hi, I have a button on an aspx page (I'm using vs2005 with asp2), which when clicked takes a while to do some data processing before it posts back to the screen to display the results. I therefore created a little animated gif, which, when the button is clicked, I display using javascript in a floating div, the idea being that the animation shows that something is happening until the postback occurs.
4
1935
by: Helmut Giese | last post by:
Hello out there, this is OT but maybe some of you were in the past faced with the same problem: I have lots of sequences of GIF files to combine into animated GIFs. I can do it 'by hand' with Microsofts Gif Animator, but given the amount of files I have to process, a tool which can be controlled from the command line looks much more attractive. Googling led me to WhirlGif, and I got it compiled (Windows) - but it appears to not like my...
2
3547
by: Scirious | last post by:
People, I need a way to detect the moment an animated GIF gets to it's end to switch to a different GIF. I can't use a Timer because the GIFs have different times and doing so (as I'm doing at the moment) causes some of the images to change before ti gets to the end and other run more than one time. Do animated GIFs trigger any event I can use to detect when it finished executing? If not, is there a way to do it?
3
6215
by: ZikO | last post by:
Hi. I am making a Multimedia Presentation in VB.NET 2005 and I have some animated GIFs which I need to use. I tried to use PictureBox for it but it doesn't play an animation in GIFs :/. What I should do to resolve this problem, do you have any suggestions? Regards.
4
6338
by: Jeff | last post by:
Hi, I'd like to write Javascript that stops animated gifs from animating. On Firefox, at least, window.stop(); does the trick, although it stops everything on the page and is kind of unpredictable. If I connect it to the onload event, sometimes only half the page will be displayed. Does the onload even fire before rendering? Does anyone know a reasonable way to accomplish my original goal of
0
1560
by: helraizer1 | last post by:
Hey, I have a PHP script that I made for an image based shoutbox with emoticons. The problem is that php GD doesn't support animated gifs, yet perl GD does. How would I make it so that I could copy the animated gifs via Perl onto the static image that I made with php? I've tried with php imagecreatefromgif(), which produces a static image. I also tried using the GIFAnimation class from phpclasses to make an animated gif but it returns it as...
9
9637
by: eneyardi | last post by:
How to add gif image to startup screen? I want to add gif image to my startup screen, is this possible that it may run as animated gif?
0
8063
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8496
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8475
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8148
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6816
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4024
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1594
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.