Recent

Author Topic: PNG in Lazarus  (Read 10956 times)

Adam.Pilorz

  • Jr. Member
  • **
  • Posts: 67
    • http://www.pilotmp3.devtown.net
PNG in Lazarus
« on: November 08, 2004, 10:38:16 am »
Hi. I'm looking for a unit or component, which will support PNG with transparency (full transparency, not only bit transparency - transparent or not), which would be free to use in commercial applications. If anybody know, where I can find something like this, please write. If such thing doesn't exist, maybe somebody have seen a short description of PNG format, not full documentation (it's too long for me), which can tell me how to read this format. If so, I would try to write some free library for it. I think it would be very useful.
Thanks in advice.

Lightning

  • Sr. Member
  • ****
  • Posts: 422
PNG in Lazarus
« Reply #1 on: November 08, 2004, 01:08:41 pm »
I think Alpha transparency(Translucency) isn't yet supported and it isn't supported by Delphi/Kylix either, so...
The problem i think is know what other stuff is drawn under your Image component so you can blend them.
Some advices would be useful on how to get what has already been drawn on the background.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

Adam.Pilorz

  • Jr. Member
  • **
  • Posts: 67
    • http://www.pilotmp3.devtown.net
PNG in Lazarus
« Reply #2 on: November 08, 2004, 10:20:17 pm »
Well, I have an idea how to write PNG with alpha transparency support, but I need a short explanation of PNG format. If anybody have seen one, please write any link (I've tried to look for one, but only thing I've found was PNG documentation, which is too long to be understood for me :) ).

Lightning

  • Sr. Member
  • ****
  • Posts: 422
PNG in Lazarus
« Reply #3 on: November 08, 2004, 10:34:21 pm »
I think it should be simple, basicaly you should have a header and the body, each pixel should be represented on 32 bit 1 Byte for each component (Red, Green, Blue, Alpha) i didn't use PNG but it's true for other formats.
Look at the sources.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

Adam.Pilorz

  • Jr. Member
  • **
  • Posts: 67
    • http://www.pilotmp3.devtown.net
PNG in Lazarus
« Reply #4 on: November 09, 2004, 09:04:42 pm »
Well, unfortunately it is not so easy. PNG is compressed, and I can't find anything to uncompress it from my application :/.

Lightning

  • Sr. Member
  • ****
  • Posts: 422
PNG in Lazarus
« Reply #5 on: November 09, 2004, 10:58:48 pm »
Did you look at the code ?
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

Adam.Pilorz

  • Jr. Member
  • **
  • Posts: 67
    • http://www.pilotmp3.devtown.net
PNG in Lazarus
« Reply #6 on: November 10, 2004, 05:53:55 pm »
Well... If I can ask... What code? The problem is I can't find anything under Pascal understanding PNG, except PasZlib, but it is only PNG-body decompressor (or I can't find procedures understanding PNG). And in addition to this it have no description how to use it with PNG's.

Lightning

  • Sr. Member
  • ****
  • Posts: 422
PNG in Lazarus
« Reply #7 on: November 10, 2004, 11:21:28 pm »
I will look too, until then search for Delphi components that use PNG, i can only help with TGA now.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 184
    • http://www.lazarus.freepascal.org
PNG in Lazarus
« Reply #8 on: November 12, 2004, 07:01:25 pm »
Lazarus uses the png reader/writer of FPImage which reads the complete transparency information. No need to reinvent the wheel. But at the moment the LCL gtk and the windows interface can only handle 1 bit transparency.

 

TinyPortal © 2005-2018