clear timage.canvas in delphi 7 : how to clear timage canvas, avoid duplicate image when changing input size? why nil command doesn't work?
this is my code

> unit outdoor;
> 
> interface
> 
> uses   Windows, Messages, SysUtils, Variants, Classes, Graphics,
> Controls, Forms,   Dialogs, StdCtrls, ExtCtrls, Menus, ComCtrls;
> 
> type   TOrderOD = class(TForm)
>     GroupBox1: TGroupBox;
>     Label1: TLabel;
>     Label2: TLabel;
>     Label3: TLabel;
>     ODpj: TEdit;
>     ODlb: TEdit;
>     ODbhn: TComboBox;
>     GroupBox2: TGroupBox;
>     ODlipat: TComboBox;
>     ODukPJ: TComboBox;
>     ODukLB: TComboBox;
>     Label4: TLabel;
>     ODbnyk: TEdit;
>     Label5: TLabel;
>     Label6: TLabel;
>     Button2: TButton;
>     Button1: TButton;
>     ODkelKI: TEdit;
>     ODkelKA: TEdit;
>     ODkelA: TEdit;
>     StatusBar1: TStatusBar;
>     Pinfo: TPanel;
>     INFOord: TEdit;
>     KelA: TRadioButton;
>     kolA: TRadioButton;
>     Label7: TLabel;
>     ODkelB: TEdit;
>     Label8: TLabel;
>     Label9: TLabel;
>     Label10: TLabel;
>     FinAts: TGroupBox;
>     FinBwh: TGroupBox;
>     KolB: TRadioButton;
>     KelB: TRadioButton;
>     FinKiri: TGroupBox;
>     KolKi: TRadioButton;
>     KelKi: TRadioButton;
>     FinKanan: TGroupBox;
>     KolKA: TRadioButton;
>     KelKA: TRadioButton;
>     Image1: TImage;
>     procedure FormCreate(Sender: TObject);   private
>     { Private declarations }   public
>     { Public declarations }   end;
> 
> var   OrderOD: TOrderOD;  var
> pj,lb,luas,banyak,atas,bawah,kiri,kanan,vwpj,vwlb : integer;
>      bahan, finishing : string;  var a:HRGN; implementation
> 
> {$R *.dfm}
> 
> procedure TOrderOD.FormCreate(Sender: TObject); begin pj        :=
> StrToInt(ODpj.Text); lb        := StrToInt(ODlb.Text); luas      := pj
> * lb; banyak    := StrToInt(ODbnyk.Text); atas      := StrToInt(ODkelA.Text); bawah     := StrToInt(ODkelB.Text); kiri     
> := StrToInt(ODkelKI.Text); kanan     := StrToInt(ODkelKA.Text); bahan 
> := ODbhn.Text; finishing := ODlipat.Text; vwpj      := pj * 10; vwlb  
> := lb * 10;
> 
> INFOord.Text := bahan + ' ' + 'Ukuran: ' + IntToStr(pj) + ' x ' +
> IntToStr(lb) + ' = ' + IntToStr(luas)
> + ' m2' + ' ' + finishing + ' ' + 'Keling' + '  ' + 'A ' + IntToStr(atas) + ' ' +  'B ' + IntToStr(bawah)  + ' ' +  'Ki ' +
> IntToStr(kiri) + ' ' +  'Ka ' + IntToStr(kanan);
> 
>  image1.Canvas := nil;  image1.Canvas.Pen.Color := clRed; 
> image1.Canvas.Brush.Color := clBlue; 
> image1.canvas.rectangle(10,10,vwpj,vwlb);  end;
> 
> 
> end.

