Link to home
Create AccountLog in
Visual Basic Classic

Visual Basic Classic

--

Questions

--

Followers

Top Experts

Avatar of dercsar
dercsar

display animated GIF/jpg/bmp in VB desktop
Do you have and idea where can I find a nice component or source to display different images on desktop?
(no .Net!)
The image control in MS Forms only supports static gifs

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Richie_SimonettiRichie_Simonetti🇦🇷

do you mean Windows desktop?

Avatar of dercsardercsar

ASKER

No, I want it on a normal VB6 form.
(Sorry if it was ambigious)

ASKER CERTIFIED SOLUTION
Avatar of PBuckPBuck

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

have you had a look at the Windows media player control or the animation control?

the animation control will play animated gifs, avi's, etc.

i think the animation control is found in the Microsoft Windows Common Controls or Microsoft Windows Common Controls 2, i can't remember.

if thats not what you want can you be a little more specific with your requirements please.

Acquiesce

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of dercsardercsar

ASKER

I have to display different images (gifs,bmps and jpgs).
What I'm looking for is a solution to display ANY of the above in the same control, so I don't have to check for image type and use a different control in run-time.

Imagine, that the Image control can display an animated gif correctly. This is what I'm looking for, but not yet found.
(I'm working in VB6)
(The Webbrowser control is not bad idea, but
1. I couldn't remove it's border
2. it cannot display bmps

1) Border can be removed
2) It displays bmp files, the problem is with file asossiation not webbrowser control.

The sample code I sent earlier provides a means to display animated GIFS using a Image() control with a 0 index.  Why can't you determine file type (using the extension at a minimum) and if it is a BMP or JPEG - display it with the Image(0).picture that is static on your form?

Only if it is a GIF does it create more references to the Image() - but even then, it still uses the placement of the original Image control for duplication.  And only if it is a GIF do you uses the other routines from that web link.

Just a suggestion ...

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of ArkArk🇷🇺

Hi
Let me explain a bit AniGif code (actually, Randy's code based on my sample from FreeVBCode). At first, code checks if file has gif format by checking GIF signature. If it is, it load it - and works correctly with animated/nonanimated gifs. If it's not a gif file, it show a msgbox:
    If Left$(fileHeader, 3) <> "GIF" Then
       MsgBox "This file is not a *.gif file", vbCritical
       Exit Function
    End If
Just remove MsgBox and then in form code:
If LoadGif(FileName,Image1) Then 'try first gif
   'my code to show gif
Else
   Image1.Pictture = LoadPicture(FileName)
End If

Regards
Ark

Avatar of Éric MoreauÉric Moreau🇨🇦

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept PBuck's comment as answer.
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
emoreau
EE Cleanup Volunteer

per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Visual Basic Classic

Visual Basic Classic

--

Questions

--

Followers

Top Experts

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.