StartMagGlass example for Delphi
{ Add LEADDef to the uses section}
var
hRoundRectRgn : HRGN;
begin
{ set the color mask to mask out a few shades of black }
LeadImage1.MagGlassMaskCount := 3;
LeadImage1.MagGlassMask[0] := RGB(0, 0, 0);
LeadImage1.MagGlassMask[1] := RGB(1, 1, 1);
LeadImage1.MagGlassMask[2] := RGB(2, 2, 2);
LeadImage1.RgnFrameType := ftNone;
LeadImage1.MagGlassPaintPalette:= LeadImage1.PaintPalette;
LeadImage1.MagGlassBitonalScaling:= LeadImage1.BitonalScaling;
LeadImage1.MagGlassPaintDither:= LeadImage1.PaintDither;
LeadImage1.MagGlassPaintScaling := LeadImage1.PaintScaling;
LeadImage1.MagGlassFlags := MAGGLASS_MASK_NORMAL;
LeadImage1.StartMagGlass (100, 100, 400, RGB(255, 0, 0), RGB(128, 128, 128), True, 1, False, CROSSHAIR_FINE, True, True);
hRoundRectRgn := CreateRoundRectRgn(0, 0, 100, 100, 25, 25);
LeadImage1.UpdateMagGlassShape(MAGGLASS_SHAPE_HRGN, hRoundRectRgn);
DeleteObject(hRoundRectRgn);
{.......some other work..............}
{.......some other work..............}
{ Stop the MagGlass }
LeadImage1.StopMagGlass();
end;