Re: Drawing on Delphi TPaintBox

Posted by Stanley on January 22, 2006

In Reply to: Re: Drawing on Delphi TPaintBox posted by DelphiLand Team on December 28, 2005

: procedure TForm1.Button1Click(Sender: TObject);
: begin
: with PaintBox1.Canvas do begin
: Brush.Style := bsSolid;
: Brush.Color := clBlue;
: Rectangle(0, 0, PaintBox1.Width, PaintBox1.Height);
: end;
: with Image1.Canvas do begin
: Brush.Style := bsSolid;
: Brush.Color := clBlue;
: Rectangle(0, 0, Image1.Width, Image1.Height);
: end;
: end;

This gives an error when there is a JPG image in the TImage component, how to resolve this?

Related Articles and Replies