PDA

View Full Version : problem with drawing gif images



digitalshooter
04-16-2009, 02:05 AM
hi everyone, I made a simple program to draw an image, I'm using C# so I convert an image file to a bitmap in .Net then use Bitmap.LockBits and glDrawPixels to draw the image. But I can draw .gif images successfully the first time only, from the second time (I changed its raster position) I'll get a completely black screen.

With .jpg or .png or .bmp I got no such problem.

Does any one having same problem with me ? Thanks for any help.

digitalshooter
04-16-2009, 04:25 AM
Maybe I don't know how to draw color-indexed images in OpenGL so it caused the problem ?

dletozeun
04-16-2009, 06:29 AM
Right now I have no idea why displaying gif pictures does not work for you but I advise you to write the loaded gif image data into another picture format like png (very straightforward with libpng).

This way, you can check your gif loader produces valid data before trying to feed it to opengl.

digitalshooter
04-16-2009, 10:45 PM
I have checked it again, this is not a bug with OpenGL, maybe somewhere else in my code. Anyway, many thanks.