[Lazarus] smart tabs but 2 spaces tab width

Marc Santhoff M.Santhoff at t-online.de
Sat Jul 19 06:01:43 CEST 2008


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');
     // prepare for modify
     img:=png.CreateIntfImage;
     png.Free;
     // modyfy

     ...... changing colors, setting alpha, ...

     // prepare for draw
     bmp:=TBitmap.Create;
     bmp.LoadFromIntfImage(img);
     img.Free;
     // paint
     ......


  If image in resources has no alpha channel (img.HasTransparency 
returns False in these cases), then in resulting image i get black 
colour where i set colTransparent (in "modyfy" code block). How to 
insert alpha channel (or maybe mask, [transparency==mask in recent 
graphics changes?]) in existing image?


-- 
   Valdas Jank┼źnas



More information about the Lazarus mailing list