Recent

Author Topic: LazRGBGraphics Problem  (Read 3701 times)

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
LazRGBGraphics Problem
« on: March 23, 2008, 03:34:03 pm »
Hi all,

when I try to install LazRGBGraphics lcl, i get this warning message.

Package is no designtime package

The package LAZRGBGraphics 0.2.1 is a runtime only package.
Runtime only packages can not be installed in the IDE.

Because of this i just add the unit directory in the compiler option. Anyway i can add the RGBGraphics to my application unit, and call the procedure in the  
LazRGBGraphics example.

Here my simple code,

procedure TForm1.Button1Click(Sender: TObject);
begin
  RGBBitmap.Canvas.OutlineColor := clRed;
  RGBBitmap.Canvas.Line(10, 10, 100, 100);

  Invalidate;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
     RGBBitmap := TRGB32Bitmap.Create(400, 300);
     RGBBitmap.Canvas.DrawMode := dmFill;
end;                                                                        

I can compile the source without any problem, but when i run the application, draws nothing. Also gdb gives no error.

Any idea about this, or did i miss something?
Thanks.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1891
RE: LazRGBGraphics Problem
« Reply #1 on: March 23, 2008, 03:42:39 pm »
It seems you forgot to draw it in the OnPaint event. Have a look at the example
procedure TFormExample.FormPaint(Sender: TObject);
begin
  if RGBBitmap = nil then Exit;
  // draw bitmap
  RGBBitmap.Canvas.DrawTo(Canvas, 180, 10);
end;

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
RE: LazRGBGraphics Problem
« Reply #2 on: March 23, 2008, 04:22:03 pm »
Yes, I forgot to add the paint section, now it is okey.
Thanks for the info.

 

TinyPortal © 2005-2018