[Lazarus] Color change don't work in TImage (windows)

wile64 wile64 at gmail.com
Mon Aug 11 14:42:56 CEST 2008


I tested...

This work :

[code]
procedure TForm1.Button3Click(Sender: TObject);
begin
 with Image1.Picture.Bitmap do begin
   Width:=100;
   Height:=120;
   // fill the entire bitmap with red
   Canvas.Pen.Color:=clBlue;
   Canvas.Line(0,0,Width,Height);
 end;
end;
[/code]

This don't work...

[code]
procedure TForm1.Button4Click(Sender: TObject);
var
  LazImage: TLazIntfImage;
  ImgHandle,ImgMaskHandle: HBitmap;
begin
  LazImage:= TLazIntfImage.create(0,0);
  LazImage.DataDescription:=GetDescriptionFromDevice(0, 0, 0); // if comment
this error handle
  LazImage.LoadFromFile('d:/lazarus/images/LazarusForm.bmp');
  LazImage.CreateBitmaps(ImgHandle, ImgMaskHandle);
  Image1.Picture.bitmap.sethandles(ImgHandle, ImgMaskHandle);
  LazImage.Free;
 with Image1.Picture.Bitmap do begin
   Canvas.Pen.Color:=clBlue;
   Canvas.Line(0,0,Width,Height);
 end;
end;
[/code]

Always white !!

Regards,

-- 
Laurent.

"If debugging is the art of removing bugs, then programming must be the art
of creating!"

My Components: http://wiki.lazarus.freepascal.org/Wile64
French Forum : http://lazforum-fr.tuxfamily.org/index.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20080811/508aa9f1/attachment-0007.html>


More information about the Lazarus mailing list