Board index » delphi » TImage : How to clear the picture inside the component

TImage : How to clear the picture inside the component

Hello,

How do you clear the image in a TImage component ?

Thank you

Raf paredis
Belgium

 

Re:TImage : How to clear the picture inside the component


myimage.canvas.pen.color:=clblack;
myimage.canvas.brush.color:=clblack;
myimage.canvas.rectangle(0,0,image.width1-1,image.heigth-1);

another way is to set the pointer to nil, but the above code is
executed anyway.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Quote
Raf Paredis wrote:

> Hello,

> How do you clear the image in a TImage component ?

Re:TImage : How to clear the picture inside the component


Quote
Raf Paredis <Hypers...@innet.be> wrote in message

news:7r7n53$1cp7@forums.borland.com...

Quote
> Hello,

> How do you clear the image in a TImage component ?

Create an empty TPicture object, then assign it to the image, like this:

procedure TForm1.Button1Click(Sender: TObject);
var EmptyPicture : TPicture;
begin
   EmptyPicture := TPicture.Create;
   Image1.Picture := EmptyPicture;
   EmptyPicture.Free;
end;

Re:TImage : How to clear the picture inside the component


On Thu, 9 Sep 1999 09:28:49 +0200, "Raf Paredis" <Hypers...@innet.be>
wrote:

Quote
>Hello,

>How do you clear the image in a TImage component ?

Image1.Picture := nil;
Nick Hodges
TeamB

Other Threads