選択シンボルをピクチャ マーカー シンボルで表示する方法

      2017/12/09

'デフォルトの選択色を変更
Sub defautl()
 
Dim pMxApp As IMxApplication
Set pMxApp = Application
 
Dim pSEnvironment As ISelectionEnvironment
Set pSEnvironment = pMxApp.SelectionEnvironment
 
Dim pColor As IColor
Set pColor = New RgbColor
pColor.RGB = vbRed
 
Set pSEnvironment.DefaultColor = pColor
 
End Sub
 
 
'選択シンボルをピクチャマーカシンボルで表示する方法
Public Sub subChangeSelectionSymbol()
     
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
     
    Dim pFSelection As IFeatureSelection
    Set pFSelection = pMxDoc.FocusMap.Layer(1)
     
    '作成した選択シンボルの有効を設定
    pFSelection.SetSelectionSymbol = True
     
    'シンプルマーカシンボル(ポイントレイヤ)
    Dim pSymbol As ISimpleMarkerSymbol
    Set pSymbol = New SimpleMarkerSymbol
     
    'IPictureMarkerSymbol Exampleを参考
    Dim pictBMPMrkSym As IPictureMarkerSymbol
    Set pictBMPMrkSym = New PictureMarkerSymbol
     
    Dim TranspColor As IRgbColor
    Set TranspColor = New RgbColor
     
    TranspColor.Red = 255
    TranspColor.Green = 255
    TranspColor.Blue = 255
     
    With pictBMPMrkSym
        .CreateMarkerSymbolFromFile esriIPictureBitmap, _
            "C:\Program Files\ArcGIS\Styles\Pictures\z_warningsign.bmp"
        .Angle = 0
        .BitmapTransparencyColor = TranspColor
        .size = 32
        .XOffset = 0
        .YOffset = 0
    End With
     
    Dim pColor As IColor
    Set pColor = New RgbColor
    pColor.RGB = vbBlue
     
    pSymbol.Color = pColor
    pSymbol.size = 20
    pSymbol.Outline = True
     
    Set pFSelection.SelectionSymbol = pictBMPMrkSym
     
End Sub

 - プログラミング, ArcGIS , ,