阅读:1433回复:2
如何用turetype字体显示点符号?
如何将点显示为truetype字体中的符号?
|
|
1楼#
发布于:2007-04-23 20:48
<P>使用ICharacterMarkerSymbol Interface</P>
<P>例子:</P> <P> '** Set some Variables<BR>Dim chMrkSym As ICharacterMarkerSymbol<BR>Set chMrkSym = New CharacterMarkerSymbol<BR>Dim aFont As IFontDisp<BR>Set aFont = New StdFont<BR>Dim aColor As IRgbColor<BR>Set aColor = New RgbColor<BR><BR>'** Define the color we want to use<BR>aColor.Red = 255<BR>aColor.Green = 0<BR>aColor.Blue = 0<BR><BR>'** Define the Font we want to use<BR>aFont.Name = "ESRI Default Marker"<BR>aFont.Size = 24<BR><BR><BR>'** Set the CharacterMarkerSymbols Properties<BR>With chMrkSym<BR> .Angle = 90<BR> .CharacterIndex = 36<BR> .Color = aColor<BR> .Font = aFont<BR> .Size = 24<BR> .XOffset = 0<BR> .YOffset = 0<BR>End With <BR></P> |
|
|
2楼#
发布于:2007-04-24 13:36
找不到字体文件!
<P> '** Set some Variables<BR> Dim pRender As IUniqueValueRenderer<BR> Dim chMrkSym As ICharacterMarkerSymbol<BR> chMrkSym = New CharacterMarkerSymbol<BR> Dim aFont As IFontDisp<BR> aFont = New StdFont<BR> Dim aColor As IRgbColor<BR> aColor = New RgbColor<BR> Try<BR> Dim i As Integer<BR> pFtLayer = Form1.AxMapControl1.Map.Layer(i)<BR> If pFtLayer.FeatureClass.ShapeType = ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint Then<BR> '** Define the color we want to use<BR> aColor.Red = 255<BR> aColor.Green = 0<BR> aColor.Blue = 0</P>
<P> '** Define the Font we want to use<BR> aFont.Name = "gx"<BR> aFont.Size = 24</P> <P> '** Set the CharacterMarkerSymbols Properties<BR> With chMrkSym<BR> .Angle = 90<BR> .CharacterIndex = 34<BR> .Color = aColor<BR> .Font = aFont<BR> .Size = 24<BR> .XOffset = 0<BR> .YOffset = 0<BR> End With<BR> pRender = New UniqueValueRenderer<BR> pRender.FieldCount = 1<BR> pRender.Field(0) = "COMPONENT" 'COMPONENT<BR> pRender.DefaultSymbol = chMrkSym<BR> End If<BR> Catch e As Exception<BR> MsgBox(Err.Description)<BR> pColor = Nothing<BR> pRender = Nothing<BR> chMrkSym = Nothing<BR> SetSdeLayerDispProperties1 = False<BR> End Try</P> <P>我把代码写成这样,可还是不行,我看可能是找不到字体文件,或是渲染不成功,哪位帮帮忙!</P><img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em02.gif" /> |
|