Image.gif
BlitzMax Forums/BlitzMax Programming/Image.gif
| ||
Does BlitzMax .gif? If so, how will insert it into a black screen boot in game? |
| ||
Blitzmax doesn't do .gif natively, but IIRC there's some code in the code archives to deal with them... There's also some 3rd party modules like Brucey's excellent bah.freeimage that can handle them. No idea what you mean by the 2nd part of your question. |
| ||
..I think he wants to use an animated image for the intro to a game (like logos, etc.). |
| ||
Local w:Int = GraphicsWidth() Local h:Int = GraphicsHeight() Local image:TImage = LoadImage("boot.gif") DrawImage(image, w - image.width / 2,h - image.height / 2) :-) |
| ||
What's the use of that if BlitzMax doesn't have a GIFLoader module? |
| ||
It might me because GIFs are limited to 256 colors(8-bits) . They seem to still be popular only because of their use in webpages. |
| ||
GIF supports more than 256 colors too. I've read some reference on it and the color pallette part is compressable. I don't know the max number of it, but i know it supports more than 256 :) |
| ||
GIF does only support 256 colors, but that's the limit *per frame*. You can create an animated GIF with multiple frames with a 0ms delay, which has the net result of a single GIF that shows more than 256 colors at the same time... But it's still a hack job. Sample: http://www.cydeweys.com/blog/2008/03/26/gifs-not-256-colors/ Extremely impractical though -- you still can't use more than 256 in a single frame. |
| ||
What's the use of that if BlitzMax doesn't have a GIFLoader module? What's the use of what? It was obviously an incomplete example, given there wasn't even a Graphics command... ... SuperStrict Framework BaH.FreeImage Import BRL.GLMax2D Import BRL.RamStream Incbin "image.gif" Local pixmap:TPixmap = LoadPixmap("incbin::boot.gif") Graphics 800, 600 Local w:Int = GraphicsWidth() Local h:Int = GraphicsHeight() Local image:TImage = LoadImage(pixmap) ' loading... Cls DrawImage(image, w - image.width / 2,h - image.height / 2) Flip ' do loady stuff.... ' etc WaitKey End |