Recent

Author Topic: Why transparency of png dont have in linux ?  (Read 9739 times)

aliotti

  • New Member
  • *
  • Posts: 17
Why transparency of png dont have in linux ?
« on: February 22, 2010, 02:32:01 pm »
Why transparency of png dont have in component TIMAGE in gtk2 in linux ?
But have in windows.

It have any difference of programming ?

Thanks.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: Why transparency of png dont have in linux ?
« Reply #1 on: February 22, 2010, 04:10:25 pm »
Full alpha support is not yet implemented on gtk
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

aliotti

  • New Member
  • *
  • Posts: 17
Re: Why transparency of png dont have in linux ?
« Reply #2 on: February 23, 2010, 05:42:53 pm »
Where is the source code of alpha transparency to png in windows to compare ?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: Why transparency of png dont have in linux ?
« Reply #3 on: February 24, 2010, 10:25:11 am »
It's not that simple. The windows widgetset is capable through winapi to display images with an alpha channel. The widgets we initially used on gtk don't have that capability. Only "relatively" recently there are libs for gtk2 which support this, but that would mean a partially rewrite of some lcl-gtk internals.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Zaher

  • Hero Member
  • *****
  • Posts: 679
    • parmaja.org
Re: Why transparency of png dont have in linux ?
« Reply #4 on: February 24, 2010, 11:55:19 am »
Why it depend on GTK, i felt png source is native code?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: Why transparency of png dont have in linux ?
« Reply #5 on: February 24, 2010, 02:18:08 pm »
I guess you want to view it somewhere ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Why transparency of png dont have in linux ?
« Reply #6 on: February 24, 2010, 04:14:47 pm »
PNG images have color and alpha channels directly available from RawImage (which is propably still a work in progress) that is not dependant on platform as far as i'm aware. When someone just has the desire to use it. Works fine with my opengl texture loading though, i don't use SDL for that.

But what's best part is that same code works for JPG, was able to make a generalized loading function.

jw

  • Full Member
  • ***
  • Posts: 126
Re: Why transparency of png dont have in linux ?
« Reply #7 on: February 24, 2010, 04:57:33 pm »
I've tried useing a transparent ping for windows lazarus and it didn't work which is why I'm trying vampyre imageing library.

lazarus ver 0.9.28.2 beta

jw

  • Full Member
  • ***
  • Posts: 126
Re: Why transparency of png dont have in linux ?
« Reply #8 on: February 28, 2010, 07:12:01 pm »
after codeing my app form vb to lazarus useing vampire imageing library I found that when running it uses 100% of the cpu which strikes me as odd as my vb app uses less then 10% and I thought free pascal and the gcc compiler would make a lot more effecient code.  This sent me back to the drawing board, While dreaming up a way to do what I need without useing vampire imageing library I may have discovered something that can help you.

I use windows so I don't know if it holds true with linux lazarus.

If you take the bitmap into an editor, I used paint.net and pick the color $00ffffff or ffffff which in  is 255 255 255 solid white and use the bucket to make the background of the bmp solid white then save this new bitmap and load it in lazarus then the Bitmap background will be transparent to the form color. 


Been reading a lot and things that annoy me are posts like this http://forum.lazarus.freepascal.org/index.php/topic,2939.0.html

it's saying transpareny is implemented with a command like 
image1.TransparentColor := Bitmap.Canvas.Pixels[0,0];
image1.Transparent := true;

this post is from 2006

the graphics wiki talks about how to make a transparnet bitmap but I've yet to find working code.
many many newer posts say alphablending and transparency ae not yet supported.
 



















 

TinyPortal © 2005-2018