AnnSetROP2 example for Delphi

Procedure TForm1.AnnSetROP2(hAnnObject: HANNOBJECT);
var
uRop2: L_UINT; { ROP2 code }
begin
{ Get the current ROP2 code }
LEADAnn1.AnnGetROP2(hAnnObject, uRop2);

{ if the code is not ANNROP2_AND, make it so }
if(uRop2 <> ANNROP2_AND)then
begin
{ make sure the FillMode is set to Transparent }
LEADAnn1.AnnSetFillMode(hAnnObject, ANNFILLMODE_TRANSPARENT, True);

{ set ROP2 code }
LEADAnn1.AnnSetROP2(hAnnObject, ANNROP2_AND, True);
end;
end;