AnnSetFillModeExt Example for Visual Basic
' The following example toggles through all supported fill modes for an annotation object.
' The background color is set to blue in each case
Private Sub ExampleAnnGetFillModeExt_Click()
Dim nRet As Integer
Dim nFillMode As Integer
Dim hObject As Long
RasterAnn.AnnCreate ANN_OBJECT_HILITE, True, True
hObject = RasterAnn.AnnObject
RasterAnn.AnnRectLeft (hObject) = 0
RasterAnn.AnnRectTop(hObject) = 0
RasterAnn.AnnRectWidth(hObject) = 100
RasterAnn.AnnRectHeight(hObject) = 100
nRet = RasterAnn.AnnSetSelected(hObject, True, False)
nRet = RasterAnn.AnnGetFillModeExt(hObject)
nRet = RasterAnn.AnnSetBackColor(hObject, RGB(0, 0, 255), True)
nFillMode = RasterAnn.AnnFillMode
Select Case nFillMode
Case ANN_FILLMODE_TRANSPARENT:
nFillMode = ANN_FILLMODE_TRANSLUCENT
Case ANN_FILLMODE_TRANSLUCENT:
nFillMode = ANN_FILLMODE_OPAQUE
Case ANN_FILLMODE_OPAQUE:
nFillMode = ANN_FILLMODE_ALPHA
Case ANN_FILLMODE_ALPHA:
Case Else:
nFillMode = ANN_FILLMODE_TRANSPARENT
End Select
' Arbitrarily set an alpha value of 128
' Note that this value is used only if the uFillMode is ANN_FILLMODE_ALPHA
nRet = RasterAnn.AnnSetFillModeExt(hObject, nFillMode, 128, True)
nRet = RasterAnn.AnnGetFillModeExt(hObject)
If (RasterAnn.AnnFillMode = ANN_FILLMODE_ALPHA) Then
MsgBox "Alpha :" + Str(RasterAnn.AnnAlpha)
End If