阅读:1492回复:1
mapcontrol中点击显示自定义符号问题
请问如何将批量的bmp图导入到style文件中,如何在mapcontrol中点击显示这些符号呢?
|
|
|
1楼#
发布于:2006-04-26 17:01
<P>下面给出了如何搜索和显示符号</P>
<P> Dim pStyleGalleryItem As IStyleGalleryItem<BR> Dim pEnumStyleGallery As IEnumStyleGalleryItem<BR> Dim pStyleGallery As IStyleGallery</P> <P> pStyleGallery = New ServerStyleGalleryClass</P> <P><BR> Dim pSymbol As ISymbol<BR> Dim bmp As Bitmap<BR> Dim imgIndex As Integer<BR> imgIndex = -1</P> <P><BR> Dim pStylStor As IStyleGalleryStorage<BR> pStylStor = pStyleGallery<BR> pStylStor.TargetFile = pServerStylePath<BR> pStylStor.AddFile(pServerStylePath)</P> <P> pEnumStyleGallery = pStyleGallery.Items(pSymbolType, "", "") 'pServerStylePath,Default</P> <P> 'If Not IsNothing(pEnumStyleGallery) Then<BR> pEnumStyleGallery.Reset()<BR> 'pStyleGalleryItem = Nothing<BR> pStyleGalleryItem = pEnumStyleGallery.Next<BR> 'Else<BR> ' Exit Sub<BR> 'End If<BR> While Not pStyleGalleryItem Is Nothing<BR> pSymbol = pStyleGalleryItem.Item<BR> '这里你可以根据符号建立图片,添加到你的程序中显示</P> <P><BR> pStyleGalleryItem = pEnumStyleGallery.Next<BR> End While</P> <P> System.Runtime.InteropServices.Marshal.ReleaseComObject(pEnumStyleGallery)<BR> pServerStylePath = Nothing<BR> pSymbolType = Nothing<BR> pStyleGalleryItem = Nothing<BR> pEnumStyleGallery = Nothing<BR> pStyleGallery = Nothing</P> |
|
|