Is there any code or function(s) that I can use in VB6 to convert a bitmap image to a GIF image (gif file)/
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
That doesn't change the picture data, just the name only
Last edited by jmsrickland; Oct 7th, 2012 at 01:37 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
Super great! You made it so any of those formats can be saved as a GIF. Nice, more than what I asked for. Thanks a lot, Mikle, great job. I see that by a few modifications any of the formats can be saved as any of the other formats.
I have two questions if you don't mind.
1) Do you know how to display the images once I load it? I tried using Picture1.Picture = LoadPicture() but it won't accept .PNG and .TIFF. Is there a way to display them without using LoadPicture?
2) Also, instead of saving the output is there a way to hold the image (and the file data) in memory (I will save later)? I'm making an app that makes animated gif images so I need all the images stored in memory with the image data (the gif file data) so later I can merge all the data into one animated gif file.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
I need all the images stored in memory with the image data
Use "GdipBitmapLockBits", then "CopyMemory" and "GdipBitmapUnlockBits" to copy image data to your array in memory.
how to display the images once I load it?
You can use "SetDIBitsToDevice", with your array, also you can use "ByVal lData.Scan0" instead of array in "Bits As Any" argument.
An example of using these functions can be found in the next topic about SR2D engine.