Click to See Complete Forum and Search --> : GIF problems
Arcom
Jan 29th, 2001, 01:29 PM
Ok, here's my problem:
I'm using a StdPicture object for storing pictures to draw on the screen. The problem is that when I try to draw (or blit, if you like it more :)) transparent GIF picture, it won't draw transparently. I'm using VB5. Perhaps this is solved in VB6, but I would really appreciate if anyone knows how to solve this problem...
invitro
Jan 30th, 2001, 12:32 PM
Try storing them in an image list, and extracting them out of there.
Arcom
Jan 31st, 2001, 02:28 PM
I tried what you suggested, but it doesn't work. I even tried using different RasterOp constants, but that didn't do much. Any other suggestions?
Arcom
Feb 3rd, 2001, 02:00 PM
I know how to use masks, but that solution is absolutely out of consideration. I need this for a program I'm making, so I don't know what pictures will be loaded...
Anyway, TransparentBlt sounds good and it works fine, but how would I know which color is to be transparent?
I know I would have to open GIF file and then find that color, but is there any simple solution to this?
Jotaf98
Feb 4th, 2001, 12:10 PM
If you have an hex editor and a program to save transparent GIFs, you could try saving the same image with different transparent colors. Then, open them with the hex editor and see what byte changes between the files. By checking that byte, you see what palette index was used for the transparency.
Arcom
Feb 4th, 2001, 04:18 PM
Thanks Jotaf98, but obviously you haven't read my previous post :)
quote: "I need this for a program I'm making, so I don't know what pictures will be loaded..."
Jotaf98
Feb 6th, 2001, 10:57 AM
Ok... if you want to know if an image is a GIF or not, check if the first 4 bytes are "GIF8" (or something - open a GIF image with Notepad and see what the first bytes are). I think there's no other way...
Arcom
Feb 6th, 2001, 03:44 PM
I found GIF file format(s) on Wotsit's, so I'll just extract the color out of the file and use TransparentBlt...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.