ImageEn, unit imageenproc

TImageEnProc.Selected

TImageEnProc.Selected


Declaration

property Selected: Boolean;


Description

Allows specification of a rect of the image to perform editing or analysis, without needing to attach a TImageEnView.

Note: If a TImageEnView is attached, Selected and SelectedRect return the TImageEnView.SelectionMask and setting them has no effect.


Example

// Load an image, set center 50% to negative and save
myBitmap := TIEBitmap.Create();
myBitmap.LoadFromFile( 'D:\Image.jpg' );
with TImageEnProc.CreateFromBitmap( myBitmap ) do
begin
  // Select center area of image
  SelectedRect := Rect( MulDiv( 25, myBitmap.Width, 100 ),
                        MulDiv( 25, myBitmap.Height, 100 ),
                        MulDiv( 75, myBitmap.Width, 100 ),
                        MulDiv( 75, myBitmap.Height, 100 ));
  Selected := True;
  Negative();
  Free;
end;
myBitmap.SaveToFile( 'D:\Image_Out.jpg' );
myBitmap.Free;


See Also

TImageEnView.SelectionMask
SelectedRect