AnnSetBitmap example for Delphi
Procedure TForm1.AnnSetBitmap(hStamp: HANNOBJECT; hPlgn:
HANNOBJECT);
var
nRet: L_INT;
clTemp: TColor;
bTransparent: Boolean;
StampBitmap: TBitmapHandle;
begin
clTemp:= 0;
StampBitmap:= 0;
nRet:= LEADAnn2.Load('C:\flagsel.bmp',
0, 1, 1);
if(nRet = SUCCESS)then
begin
LEADAnn1.AnnSetBitmap(hStamp,
LEADAnn2.Bitmap, False);
LEADAnn1.AnnSetAutoBackColor(LEADAnn1.AnnAutomation, ANNOBJECT_ALL,
TColor(RGB(40, 80, 160)));
LEADAnn1.AnnGetAutoBackColor(LEADAnn1.AnnAutomation,
ANNOBJECT_POLYGON, clTemp);
ShowMessage('AutoBackColor: ' + ColorToString(clTemp));
LEADAnn1.AnnGetTransparent(hStamp,
bTransparent);
if(Not(bTransparent))then
LEADAnn1.AnnSetTransparent(hStamp,
True, False);
LEADAnn1.AnnSetTransparentColor(hStamp,
clGreen, False);
LEADAnn1.AnnGetTransparentColor(hStamp,
clTemp);
ShowMessage('TransparentColor: ' +
ColorToString(clTemp));
LEADAnn1.AnnSetBackColor(hPlgn,
TColor(RGB(255, 0, 255)), False);
LEADAnn1.AnnGetBackColor(hPlgn,
clTemp);
ShowMessage('BackColor: ' + ColorToString(clTemp));
LEADAnn1.AnnSetForeColor(hPlgn,
TColor(RGB(0, 255, 255)), False);
LEADAnn1.AnnGetForeColor(hPlgn,
clTemp);
ShowMessage('ForeColor: ' + ColorToString(clTemp));
LEADAnn1.AnnGetBitmap(hStamp,
StampBitmap);
LEADAnn1.Bitmap:= StampBitmap;
end;
end;