Lazarus
Programming => Graphics and Multimedia => Graphics => Topic started by: aliotti 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.
-
Full alpha support is not yet implemented on gtk
-
Where is the source code of alpha transparency to png in windows to compare ?
-
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.
-
Why it depend on GTK, i felt png source is native code?
-
I guess you want to view it somewhere ?
-
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.
-
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
-
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.