Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-08

Color change don't work in TImage (windows)

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

wile64

Hi,

This code work on Linux not on Windows xp.
// Preview is a TImage.
[code]
  Preview.Canvas.Pen.Color:=clblue;
  Preview.Canvas.Line(...);
[/code]

The color is always White on Windows (with last svn).

Thanks,

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://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080809/5dbdfd0e/attachment.html

Reply by email

wile64
to Mattias Gaertner

2008/8/9 Mattias Gaertner

Show quoted text 21 lines
On Sat, 9 Aug 2008 10:26:37 +0200 wile64 wrote: > Hi, > > This code work on Linux not on Windows xp. > // Preview is a TImage. > > [code] > Preview.Canvas.Pen.Color:=clblue; > Preview.Canvas.Line(...); > [/code] > > The color is always White on Windows (with last svn). See http://wiki.lazarus.freepascal.org/Developing_with_Graphics#Draw_to_a_TImage Mattias

Thanks Mattias,

I do not believe that it rule my problem, it seems to me having tested several solution...

I look in the week, no time now

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://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080809/051fd2bf/attachment.html

Reply by email

wile64
to wile64

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://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080811/508aa9f1/attachment.html

Reply by email