IS there any example to loop using scanline through a selection (TIEMask), instead of using getpixel? What I have tried did not work so far. It seems as the scanline property in a TIEMask acts differently than the scanline of a TIEBitmap.
Thanks.
I am looking to convert the following sample code to scanline:
procedure TestMaskScanline1;
var
k, x,y, x1,x2,y1,y2, pc: integer;
polysel:ppointarray;
mask:Tiemask;
p: pbyte;
bpp: integer;
begin
case ImageEnView1.IEBitmap.PixelFormat of
ie8g: bpp := 1;
ie24RGB: bpp := 3;
else
exit;
end;
imageenview1.proc.GetReSel(x1,y1,x2,y2,polysel, pc, mask);
for y := y1 to y2 do
begin
p := imageenview1.ieBitmap.scanline[y];
inc(p, x1 * bpp);
for x:= x1 to x2 do
begin
if mask.GetPixel(x, y)>0 then
p^ := 255;
for k := 1 to bpp do
inc(p);
end;
end;
end;
Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library