Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create a GIF in VB?

Status
Not open for further replies.

mmbsports

Programmer
Oct 25, 2005
22
US
Basically, I have a form that has moveable objects on it. Once the user moves the objects in the location he/she would want them to be in, I want my program to take a snapshot (of sorts) of that form in order to create a GIF so I can place the GIF on a web page for viewing...and I'll save the GIF to the harddrive for future reference.

I reviewed the MS KB and from there it almost reads as if this is possible, but I have ran into a deadend.

I did find this site, which was cool, but it converts an ascii file into a bitmap...close, but no cigar.
Thanks for any help this forum might provide.
 
You could find a way to send a Shift/Prtsc and then capture the clipboard contents. Not sure how to do this. There's probably a better way to do it using the API, too. But that's where I'd begin looking.
 
Google GIF89.DLL, which allows you to convert JPG to GIF.
I've posted an example on another forum under the same user name.

David
 
There seems to be a problem with GIF89.DLL. I've seen allot of programmers complain about it hosing up a user's computer. I would prefer to stay away from items like that. THANK YOU THOUGH!! I appreciate any ideas!

The clipboard is an idea I will look into further. I didn't think about that way. And i know VB allows you to extract from the clipboard as well.

However, there must be a way to capture my data that is within the "frame" object that is on my form and make it into a bitmap or gif. If anyone else has an idea, I would appreciate some advice.

Thanks!
 
>make it into a bitmap

Do a keyword search in this forum. We've provided multiple examples on how to do this, so you should be able to find a suitable one.

>or gif

I've provided at least one example of how to do this in VB without use of a 3rd party DLL ( or having to understand the gif file format, although it does use a TLB to give proper access to Microsoft's GDI+, which isn't normally VB friendly). Again, a keyword search should be your first port of call
 
I did a search previously and found these..and many others:


They come close to what I am asking, but doesn't provide the answer.

I guess maybe I am overlooking the answer...or thinking too hard.

The easiest answer I found is that if all my objects were contained in a picturebox, then I can simply use the save feature the picturebox provides...too easy. The problem is, my objects (which are many pictureboxes) are contained in the frame object.

If only there is a way to capture the content in the frame object and save it as a gif or bitmap like you do with picturebox...that is what I want to do. OR, find the x,y pos of the frame object, and capture the contents within the x,y and save as bitmap...

I'll continue to search, but so far I have come up empty handed.

Once I find a solution, I will post it here...with full code...so that everyone can have access to it without hunting around like I have.

If you have further suggestions, that would be great!

THANKS!!
 
A valuable member of this forum figured out how to do this on the fly.

refer to thread222-1157687 for complete instructions.

It is possible to create a bmp within a picturebox containing with dynamic labels and other objects. the code provided is plug and play!! Outstanding Code!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top