小弟向图层中添加图元,可以填加成功(有记录)但什么也看不见,应该是需要设置Symbol后再添加,但应该什么加呢?下面是代码
Dim mPoint As IPoint
Dim m_pMpt As IMultipoint
Dim m_pPtColl As IPointCollection
Dim pPolygon As Polygon
Dim pWorkspaceFactory As IWorkspaceFactory
Dim pWorkspaceEdit As IWorkspaceEdit
Dim pFeatureLayer As IFeatureLayer
Dim pDataSet As IDataset
Dim pFeature As IFeature
'pGeoms_Polyline = New Collection
mPoint = New Point
m_pMpt = New Multipoint
m_pPtColl = m_pMpt
'第一个点
mPoint.X = AxMapControl1.Bounds.X
mPoint.Y = AxMapControl1.Bounds.Y
m_pPtColl.AddPoint(mPoint)
'第二个点
mPoint.X = AxMapControl1.Bounds.X + AxMapControl1.Bounds.Width
mPoint.Y = AxMapControl1.Bounds.Y
m_pPtColl.AddPoint(mPoint)
'第三个点
mPoint.X = AxMapControl1.Bounds.X + AxMapControl1.Bounds.Width
mPoint.Y = AxMapControl1.Bounds.Y + AxMapControl1.Bounds.Height
m_pPtColl.AddPoint(mPoint)
'第四个点
mPoint.X = AxMapControl1.Bounds.X
mPoint.Y = AxMapControl1.Bounds.Y + AxMapControl1.Bounds.Height
m_pPtColl.AddPoint(mPoint)
'第五个点
mPoint.X = AxMapControl1.Bounds.X
mPoint.Y = AxMapControl1.Bounds.Y
m_pPtColl.AddPoint(mPoint)
pPolygon = New Polygon
pPolygon.AddPointCollection(m_pPtColl)