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.
procedure CustomNegative( proc: TImageEnProc );
var
ProcBitmap: 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', ProcBitmap, 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(ProcBitmap, mask);
end;
..
ImageEnView1.SelectEllipse( 100, 100, 100, 100 );
CustomNegative( ImageEnView1.Proc );