10楼#
发布于:2005-08-16 20:10
<P>感激不尽</P>
<P>这个问题,我也知道该这样做了,但是我的符号库是symbol.style 我用AE提供的工具MakeServerStyleset将他转换成symbol.serverstyle</P> <P>但是在程序执行到</P> <P> Set pStyleItem = pEnumStyleGall.Next<BR> Do While Not pStyleItem Is Nothing<BR>时 pstyleitem始终都是nothing</P> <P>最后导致程序出错</P> <P>是怎么回事</P> <P>谢谢执教</P> |
|
11楼#
发布于:2005-08-16 09:47
<P>'***************************************************<BR>'名称: SymbolInit<BR>'功能描述: 初始化显示点、线、面对象时所用的Symbol<BR>'传入参数: 无<BR>'依赖关系: 无<BR>'作者: <BR>'创建日期 </P>
<P>'***************************************************<BR>Public Sub SymbolInit()<BR>On Error GoTo errh<BR>ReadIni<BR>Dim pRen As ISimpleRenderer<BR>Dim pGeoFeatLyr As IGeoFeatureLayer<BR> </P> <P>Dim i As Integer<BR>Dim l As Integer<BR>For i = 0 To Form1.map1.LayerCount - 1<BR> For l = 1 To iMaxNum</P> <P> If Form1.map1.layer(i).Name = layer(l) Then</P> <P> Set pGeoFeatLyr = Form1.map1.layer(i)<BR> Set pRen = pGeoFeatLyr.Renderer<BR> <BR> Dim pSimpleRenderer As ISimpleRenderer<BR> Dim pSimpleMarkerSymbol As ISimpleMarkerSymbol<BR> <BR> Dim pRgbColor As IRgbColor<BR> <BR> Set pSimpleRenderer = New SimpleRenderer<BR> Set pSimpleMarkerSymbol = New SimpleMarkerSymbol<BR> <BR> Dim pStyleGal As IStyleGallery<BR> Dim pStyleStorage As IStyleGalleryStorage<BR> Dim pEnumStyleGall As IEnumStyleGalleryItem<BR> Dim pStyleItem As IStyleGalleryItem<BR> Set pStyleGal = New ServerStyleGallery<BR> Set pStyleStorage = pStyleGal<BR> pStyleStorage.TargetFile = App.Path ; "\water.ServerStyle"<BR> Set pEnumStyleGall = pStyleGal.Items("Marker Symbols", "", "")<BR> <BR> pEnumStyleGall.Reset<BR> Set pStyleItem = pEnumStyleGall.Next<BR> Do While Not pStyleItem Is Nothing<BR> <BR> If pStyleItem.Name = symindex(l) Then<BR> Dim pSym As ISymbol<BR> Set pSym = pStyleItem.Item<BR> <BR> GoTo ExitLOOP<BR> End If<BR> Set pStyleItem = pEnumStyleGall.Next<BR> Loop<BR>ExitLOOP:<BR> Set pRen.Symbol = pSym<BR> Form1.map1.layer(i).Visible = show(l)<BR> <BR> End If</P> <P> Next<BR>Next</P> <P>Form1.map1.Refresh</P> <P>errh:<BR> If Err.Number <> 0 Then<BR> MsgBox Err.Number ; Err.Description, vbOKOnly + vbInformation ; "2"<BR> End If<BR> <BR>End Sub</P> |
|
|
上一页
下一页