Author Topic: Loading PNG into Imagebuffer  (Read 4926 times)

0 Members and 1 Guest are viewing this topic.

Offline psygate

  • Completly Insane.
  • Atari ST
  • ***
  • Posts: 173
  • Karma: 7
  • That boy needs therapy.
    • View Profile
Loading PNG into Imagebuffer
« 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
He who controlles the minds commands the many.
He who commands the many, conqueres the minds.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Loading PNG into Imagebuffer
« Reply #1 on: December 29, 2006 »
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:

Offline psygate

  • Completly Insane.
  • Atari ST
  • ***
  • Posts: 173
  • Karma: 7
  • That boy needs therapy.
    • View Profile
Re: Loading PNG into Imagebuffer
« Reply #2 on: December 29, 2006 »
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.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Loading PNG into Imagebuffer
« Reply #3 on: January 02, 2007 »
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:

Offline TbbW

  • ZX 81
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Emperium Xenos
Re: Loading PNG into Imagebuffer
« Reply #4 on: January 05, 2007 »
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")

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Loading PNG into Imagebuffer
« Reply #5 on: January 05, 2007 »
Thanks TbbW, welcome to the forums!

Jim
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Loading PNG into Imagebuffer
« Reply #6 on: January 05, 2007 »
Yep,  :hi: Hope you stick around!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline TbbW

  • ZX 81
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
    • Emperium Xenos
Re: Loading PNG into Imagebuffer
« Reply #7 on: January 07, 2007 »
thanks  :cheers: