RgnChange example for Delphi

The following code for the RasterView RgnChange event updates a text box using the GetRgnArea method. You can test it by adding a text box for the lesson described in Outlining, Dragging, and Pasting a Region.

procedure TForm1.LEADRasterView1RgnChange (Sender: TObject);
var
   MyText: String;
begin
   MyText:= 'Number of pixels in region: ';
   MyText:= MyText + IntToStr(LEADRasterView1.Raster.GetRgnArea);
   ShowMessage (MyText);
end;