Results 1 to 7 of 7

Thread: [RESOLVED] Bitmap to GIF

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Resolved [RESOLVED] Bitmap to GIF

    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.

  2. #2
    Lively Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    111

    Re: Bitmap to GIF

    Use GDI+ for it.

  3. #3
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,535

    Re: Bitmap to GIF

    try these: http://www.catenary.com/howto/bmp2gif.html (maybe you need a library: VIC32.DLL)
    and: http://www.vbmania.com.br/pages/inde...ir&varID=93906
    or just save it for gif format
    i hope help you
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Bitmap to GIF

    Quote Originally Posted by joaquim View Post
    try these: http://www.catenary.com/howto/bmp2gif.html (maybe you need a library: VIC32.DLL)
    and: http://www.vbmania.com.br/pages/inde...ir&varID=93906
    or just save it for gif format
    i hope help you
    No way! That DLL is $499.00

    Also, you cannot do this:

    Picture1.Picture = LoadPicture("c:\mypicture.bmp")

    SavePicture Picture1, "c:\mypicture.gif"

    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.

  5. #5
    Lively Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    111

    Re: Bitmap to GIF

    I already wrote:
    Use GDI+ for it.
    Load and save all GDI+ formats, example:
    Attached Files Attached Files

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Bitmap to GIF

    Quote Originally Posted by Mikle View Post
    I already wrote:

    Load and save all GDI+ formats, example:
    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.

  7. #7
    Lively Member Mikle's Avatar
    Join Date
    Oct 2009
    Location
    Tuapse, Russia
    Posts
    111

    Re: Bitmap to GIF

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width