Dark Bit Factory & Gravity
PROGRAMMING => Freebasic => Topic started by: psygate on December 29, 2006
-
Good Evening!
I have a little problem. I really need your help because I'd like to load an .png image into an imagebuffer which I have declared in my program, but I don't know anything about the format of png files nor about libraries which could help me... So could someone from this forum help me to realize what I want? PLZ
-
You're talking about freebasic? ImageBuffers are Blitz.
You want libpng which comes pre-made with freebasic.
Look in the examples folder inside freebasic, and in the gfx folder there's an example called png_read.bas
Everything you need is in there.
Jim
-
tHX!
BDW: imagebuffers are also freebasic! jsut look at the reference under "createimage() and destroyimage()"
-
Cool question and something I've wanted to investigate for tinyptc.
I've not yet looked at the examples for this, does anyone know if LibPng utilizes the GFXLib command set?
Cheers,
Clyde.
-
or use the Pload lib... its a static lib.
Pload() freebasic.net (http://www.freebasic.net/forum/viewtopic.php?t=4033&highlight=pload)
same if you get the zlib static lib for fb ( can be found on the fb forum )
it works werry simple:
dim picbuffer as any ptr
picbuffer = pload("filename.png")
-
Thanks TbbW, welcome to the forums!
Jim
-
Yep, :hi: Hope you stick around!
-
thanks :cheers: