Results 1 to 7 of 7

Thread: [RESOLVED] Bitmap to GIF

  1. #1
    PowerPoster
    Join Date
    Jan 08
    Posts
    6,746

    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)/
    The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved


    When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day

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

    Re: Bitmap to GIF

    Use GDI+ for it.

  3. #3
    PowerPoster joaquim's Avatar
    Join Date
    Apr 07
    Posts
    2,494

    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
    PowerPoster
    Join Date
    Jan 08
    Posts
    6,746

    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.
    The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved


    When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day

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

    Re: Bitmap to GIF

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

  6. #6
    PowerPoster
    Join Date
    Jan 08
    Posts
    6,746

    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.
    The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved


    When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day

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

    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
  •