Re: [Lazarus] Create transparency

2008-07-22 Thread Valdas Jankūnas
Luiz Americo Pereira Camara rašė: I tried that sometime ago without success: http://thread.gmane.org/gmane.comp.ide.lazarus.general/22010 I studied Your code and found where problem is: DataDescription need initialize through variable. Working code (seems that TRGBA comes from GraphicEx.pas,

Re: [Lazarus] Create transparency

2008-07-22 Thread Valdas Jankūnas
Marc Weustink rašė: Valdas Jankūnas wrote: Marc Weustink rašė: A faster way, (which might work in most cases) is when you have a 24bit depth description with a 32bits per pixel image. How retrieve image description from TBitmap? IntfImage.DataDescription Then you can simply add

Re: [Lazarus] Create transparency

2008-07-21 Thread Marc Weustink
Valdas Jankūnas wrote: Hello, My code loads a PNG image from resource, modifies it, and then paints on canvas: var png: TPortableNetworkGraphic; img: TLazIntfImage; bmp: TBitmap; begin // load from resource png:=TPortableNetworkGraphic.Create;

Re: [Lazarus] Create transparency

2008-07-21 Thread Valdas Jankūnas
Marc Weustink rašė: A faster way, (which might work in most cases) is when you have a 24bit depth description with a 32bits per pixel image. How retrieve image description from TBitmap? Then you can simply add an alpha description (precision=8, shift=24 or 0) to the rawimage. How i

Re: [Lazarus] Create transparency

2008-07-21 Thread Marc Weustink
Valdas Jankūnas wrote: Marc Weustink rašė: A faster way, (which might work in most cases) is when you have a 24bit depth description with a 32bits per pixel image. How retrieve image description from TBitmap? IntfImage.DataDescription Then you can simply add an alpha description

Re: [Lazarus] Create transparency

2008-07-21 Thread Luiz Americo Pereira Camara
Valdas Jankūnas wrote: I found another solution to not use a proxy image, but load resource from stream directly to LazIntfImage (created with Init_BPP32_B8G8R8A8_BIO_TTB description). Now i always got alpha channel and code is flexible to various image types (need just change image

[Lazarus] Create transparency

2008-07-18 Thread Valdas Jankūnas
Hello, My code loads a PNG image from resource, modifies it, and then paints on canvas: var png: TPortableNetworkGraphic; img: TLazIntfImage; bmp: TBitmap; begin // load from resource png:=TPortableNetworkGraphic.Create; png.LoadFromLazarusResource('a_png_image');