| ImageEn, unit imageenproc |
|
TImageEnProc.EndImageProcessing
Declaration
procedure EndImageProcessing(ProcBitmap: TIEBitmap; Mask: TIEMask);
Description
BeginImageProcessing and EndImageProcessing allow you to create custom image processing functions that automatically handle selection area, pixel format consistency and undo.
| Parameter | Description |
| ProcBitmap | The bitmap to process |
| Mask | The selection mask |
By using BeginImageProcessing/EndImageProcessing, you can avoid considering if the selection is rectangle, elliptical, irregular or magic wand, just process the bitmap as a rectangle.
Example
procedure CustomNegative( proc: TImageEnProc );
var
procBmp: TIEBitmap;
Mask: TIEMask;
x1, y1, x2, y2: Integer;
x, y: Integer;
px: PRGB;
begin
// we support only ie24RGB format
if not proc.BeginImageProcessing([ie24RGB], x1, y1, x2, y2, 'CustomNegative', procBmp, Mask) then
exit;
for y := x1 to x2 - 1 do
begin
px := ProcBitmap.Scanline[y];
for x := y1 to y2 - 1 do
begin
with px^ do
begin
r := 255-r;
g := 255-g;
b := 255-b;
end;
Inc( px );
end;
end;
// finalize
proc.EndImageProcessing( procBmp, Mask );
end;
..
ImageEnView1.SelectEllipse( 100, 100, 100, 100 );
CustomNegative( ImageEnView1.Proc );