关于mapobjects中创建symbol的问题

kbbkkbbk0622 2003-04-04 07:04:41
我在vb中使用mapobjects想建立非mo自带的风格的symbol而是我自己所需要的风格的symbol,请问可以实现吗》如何实现?
谢谢
...全文
89 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sunspot_2000 2003-04-17
  • 打赏
  • 举报
回复
对于点状符号可以采用cuixiutao(人如吹) 的方法把点符号作为一个注记来“RENDER",cuixiutao(人如吹) 已经描述,对于线状符号可以用富融公司的MoSymbol软件,编辑线符号,然后在VB中引用MoSymbol.dll其中一些函数可以绘制线符号
kangde 2003-04-15
  • 打赏
  • 举报
回复
在MO自带的VC例子中有一个用图标来标注的例子,图标可以自己定义,那岂不美哉
cuixiutao 2003-04-12
  • 打赏
  • 举报
回复

Private Sub Form_Load()

Dim bmpSym As New rkCustom.customIMarker

'Use the SetFileName property to set the location of the
'image to use as the symbol
bmpSym.SetFileName App.Path & "\VBeye.gif"
Set Map1.Layers(0).Symbol.Custom = bmpSym

End Sub

下面实现mo的一个接口AFCustom
Option Explicit

'Indicate that this class will implement ICustomMarker
'Remember that you must first browse for the type library
Implements AFCustom.ICustomMarker

'Internal data members
Private m_filename As String
Private m_dpi As Double
Private m_picture As IPicture

'External method which allows users to specify the
'image path and name to be rendered.
Public Sub SetFileName(fn As String)
m_filename = fn
End Sub

'The draw method. This method is called for each symbol.

Private Sub ICustomMarker_Draw(ByVal hDC As Long, ByVal x As Long, ByVal y As Long)
Dim pixWidth As Double, pixHeight As Double

'Convert the picture width (normally in HI_METRIC) to pixels
'using the previously stored dpi member.
pixWidth = m_picture.Width * m_dpi / 2540
pixHeight = m_picture.Height * m_dpi / 2540

'Always check for a valid interface before using it.
If Not m_picture Is Nothing Then
'Render the picture, centered on the given point.

m_picture.Render hDC, x - pixWidth / 2, y + pixWidth / 2, pixWidth, -pixHeight, _
0, 0, m_picture.Width, m_picture.Height, Null
End If

End Sub

'This method is called once per refresh, at the completion of rendering.
Private Sub ICustomMarker_ResetDC(ByVal hDC As Long)
'Set the picture object to nothing, free all resources.
Set m_picture = Nothing
End Sub

'This method is called once per refresh, prior to rendering.
Private Sub ICustomMarker_SetupDC(ByVal hDC As Long, ByVal dpi As Double, ByVal pBaseSym As Object)

'Store the dots per inch.
m_dpi = dpi

'Try to load the specified picture.
Set m_picture = LoadPicture(m_filename)
End Sub

cuixiutao 2003-04-12
  • 打赏
  • 举报
回复
另外一个思路是用customsymbol做。mo有例子
cuixiutao 2003-04-12
  • 打赏
  • 举报
回复
我给你提供一个思路:把你的符号做成truetype的字体归为某个字体,它就在这个字体里面有了一个索引号,然后把你的symbol的属性设置好:比如你做的符号添加到“Arial”字体里,索引号为122。
那么: dim fnt as font
font.name="arail"
set symbol.font=fnt
symbol.characterindex=122
然后你就可以画出此符号了。这只是大概代码
kbbkkbbk0622 2003-04-08
  • 打赏
  • 举报
回复
关键就是不知道如何实现,能给出具体的代码或是方法吗?
newyon 2003-04-07
  • 打赏
  • 举报
回复
自己做!

2,156

社区成员

发帖
与我相关
我的任务
社区描述
它是一种特定的十分重要的空间信息系统。它是在计算机硬、软件系统支持下,对整个或部分地球表层(包括大气层)空间中的有关地理分布数据进行采集、储存、管理、运算、分析、显示和描述的技术系统。
社区管理员
  • 地理信息系统
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧