AnnPointOptions example for C++ Builder
// This example toggles the appearance of a point annotation
object
// The appearance toggles between bitmap to circle
void TForm1::ExampleAnnPointOptions ( HANNOBJECT hObject
)
{
L_INT nObjectType;
nObjectType = LEADAnn1->AnnGetType(hObject);
if( nObjectType != ANNOBJECT_POINT )
ShowMessage("This object is not
an Point Option") ;
LEADAnn1->AnnPointOptions->Flags = ANNPOINT_ALL;
LEADAnn1->AnnGetPointOptions
(hObject);
if (LEADAnn1->AnnPointOptions->PointBitmap
== NULL)
{
ShowMessage("There is no raster
associated");
return ;
}
if(LEADAnn1->AnnPointOptions->PointUseBitmap
== True)
{
LEADAnn1->AnnPointOptions->PointUseBitmap
= False;
LEADAnn1->AnnPointOptions->PointFixedSize
= False;
LEADAnn1->AnnPointOptions->PointTransparentFill
= False;
LEADAnn1->AnnPointOptions->PointBorderColor
= (TColor)RGB(0, 0, 0);
LEADAnn1->AnnPointOptions->PointFillColor
= = (TColor)RGB(255, 255, 0);
LEADAnn1->AnnPointOptions->PointRadius
= 12;
LEADAnn1->AnnPointOptions->Flags = (ANNPOINT_USE_BITMAP
+
ANNPOINT_RADIUS
+
ANNPOINT_BORDER_COLOR
+
ANNPOINT_FILL_COLOR
+
ANNPOINT_TRANSPARENT_FILL
+
ANNPOINT_FIXED_SIZE);
}
else
{
//Change Point appearance to a bitmap
LEADAnn1->AnnPointOptions->PointUseBitmap
= True;
LEADAnn1->AnnPointOptions->PointBitmapTransparent
= True;
LEADAnn1->AnnPointOptions->PointBitmapTransparentColor=
(TColor)RGB(255, 255, 255);
}
LEADAnn1->AnnFlags
= 0;
LEADAnn1->AnnSetPointOptions(hObject);
}