I was looking for a simple rotary graphic to indicate that a program was busy performing a task. I found such an image at this Web site: http://www.ajaxload.info/
You can change the color combinations to produce and download the Animated GIF file. I have included 2 circular busy GIFs, one with a white background and one with a light yellow background.
Unfortunately, VB6 does not directly support animated GIF files. Based on an Animated GIF Control by Jen Sam Lam, I put together the attached User Control. An animated GIF is a layered structure consisting of a number of frames. Because none of the picture based controls in VB6 support the layered structure, it is broken up into the individual frames in an Image array. In this case there are 8 frames controlled by a timer.
The individual frames are converted into a temporary file and loaded to the image array. I was wondering if there was a more direct way of loading the individual frames. Feedback is welcome.
J.A. Coutts
Updated: 06/20/2020 - See later post for details
Last edited by couttsj; Jun 21st, 2020 at 09:27 AM.
BusyGIF would produce a permission error when the executable it was used in was loaded into the "Program Files" directory. This was caused by trying to create a temporary file in the same directory as the executable. The proper place for a temporary file is the "Temp" directory, and the program has be adjusted to do that. As well, code was added to stop and start the animation by clicking on the status label.
i put some sample about:webbrowser,DirectShow,ANIGIF.OCX (Animation GIF Control)
you can try
vb6 Show Gif Movie by ActiveMovie control(DirectShow),WebBrowser-VBForums https://www.vbforums.com/showthread....ow)-WebBrowser
Code:
Private Sub Form_Load()
WebBrowser1.Navigate App.Path & "\ajax-loader2.gif"
WebBrowser1.Visible = False
End Sub
Private Sub cmdStart_Click()
lblStatus.Caption = "Connecting!"
WebBrowser1.Visible = True
End Sub
Private Sub cmdStop_Click()
lblStatus.Caption = "Status"
WebBrowser1.Visible = False
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
With WebBrowser1.Document.body
.Style.border = "none"
.Scroll = "no"
.leftMargin = 0
.topMargin = 0
WebBrowser1.Width = .scrollHeight * Screen.TwipsPerPixelX
WebBrowser1.Height = .scrollHeight * Screen.TwipsPerPixelY
' WebBrowser1.Left = lblStatus.Width - WebBrowser1.Width
' WebBrowser1.Top = lblStatus.Top
' lblStatus.Height = WebBrowser1.Height
WebBrowser1.Left = lblStatus.Width - WebBrowser1.Width - 50
WebBrowser1.Top = lblStatus.Top + 50
lblStatus.Height = WebBrowser1.Height + 100
End With
End Sub
Private Sub byAniGif_Click()
Form1.Show
End Sub
Last edited by xiaoyao; Mar 16th, 2021 at 10:49 AM.
i put some sample about:webbrowser,DirectShow,ANIGIF.OCX (Animation GIF Control)
you can try
Yes, "Gif by WebBrowser" will work, but I am interested in using as few resources as possible. My latest version (BusyGIF2) uses 2.5 MB of memory when running as an executable. If I strip everything out of your "Gif by WebBrowser" program but form2, it uses 20.5 MB of memory when running as an executable. This is probably due to the size of the library file in use.
13,881,856 ieframe.dll
1,501,184 quartz.dll