• Welcome to Dark Bit Factory & Gravity.
 

Loading PNG into Imagebuffer

Started by psygate, December 29, 2006

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

psygate

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
He who controlles the minds commands the many.
He who commands the many, conqueres the minds.

Jim

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
Challenge Trophies Won:

psygate

tHX!

BDW: imagebuffers are also freebasic! jsut look at the reference under "createimage() and destroyimage()"
He who controlles the minds commands the many.
He who commands the many, conqueres the minds.

Clyde

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.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

TbbW

or use the Pload lib... its a static lib.
Pload() freebasic.net
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")

Jim

Thanks TbbW, welcome to the forums!

Jim
Challenge Trophies Won:

Shockwave

Yep,  :hi: Hope you stick around!
Shockwave ^ Codigos
Challenge Trophies Won:

TbbW