473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Flickering gifs

vdraceil
236 100+
I use a timer for loading a series of gif images.when doing so,when each gif is loaded a flick occurs..i have to use gif images for their transparent background properties.what should i do to prevent these flickerings?
Apr 8 '08 #1
4 1482
gobblegob
133 100+
hi vdradeil,
Use a WebBrowser Control instead of a timer

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. 'Resize the WebBrowser control to the size of the picture
  3. With WebBrowser1
  4.   .Width = Image1.Width + 45
  5.   .Height = Image1.Height + 45
  6. End With
  7. 'Call the function to display the image in the WebBrowser control
  8. Call ShowAnimatedGIF(WebBrowser1, Image1, App.Path & "\image.gif")
  9. End Sub
  10.  
  11. Public Sub ShowAnimatedGIF(WB As Control, _
  12.   img As Control, ByVal sFileGIF As String)
  13.   Dim sHTML As String
  14.   'define size
  15.   img.Picture = LoadPicture(sFileGIF)
  16.   With WB
  17.     'size of WebBrowser control
  18.     .Width = img.Width + 45
  19.     .Height = img.Height + 45
  20.     'HTML code to show the graphic
  21.     sHTML = "about:" & _
  22.       "<html>" & _
  23.       "<body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0 scroll=no>" & _
  24.       "<img src=""" & sFileGIF & """></img></body></html>"
  25.     .Silent = True
  26.     .Navigate sHTML
  27.   End With
  28. End Sub
GobbleGob.
Apr 10 '08 #2
Killer42
8,435 Expert 8TB
Another possibility is to use the "double buffering" technique. That is, don't load the image directly to the display. Load it into a hidden picturebox (or whatever), then once Windows has had a chance to finish rendering the image, move it to the front or make it visible. You'd probably have two pictureboxes, and switch back and forth each time you load another image.
Apr 11 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

if your Gif's are smaller, you can load them in an Image Control..
and later on depending on the Index, you can load them to the pict/image control...
can you post the code in Timer1_Timer event..

Regards
Veena
Apr 11 '08 #4
daniel aristidou
491 256MB
In new versions of vb enable the double buffering property of the form. then use doublebuffering syntax
Apr 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: jerrygarciuh | last post by:
Hello everyone, Wondering if anyone else has had problems with gifs created by php or if anyone sees a problem with this code. Symptom: created jpegs work fine and created gifs work fine...
2
by: John Lee | last post by:
Hi, I have a windows application that uses the listview to display about 50 items in detailed view - 4 columns. The first column is static and other columns will be updated in 100-1000ms - it...
2
by: John Lee | last post by:
Thanks Jay for your response. I tried your code and it still flickering a lot. To demonstrate it, you can grab a listview, create 3 columns - name, value, timestamp, in form_load event to add 50...
0
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.)...
5
by: n00b | last post by:
I have some forms with maybe around 30 controls on each and anytime I load these forms different parts of it start flickering though not all of them at once and not the same ones everytime. the...
6
by: Mark Thompson | last post by:
I have a problem with my Visual Basic .NET 2003 application which I have so far been unable to resolve. I am trying to get an OpenGL control that I have created working properly as a control on...
2
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...
3
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...
4
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...
1
by: sj | last post by:
Flickering Subform! I am developing a Quotation system in Access 03. At entry, users enter data thru' a form with subform. However, the subform keep flicker when I run the system on computer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...

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.