阅读:1069回复:0
问个问题!!!!!
<P>画了个图,是5个点的多边形</P>
<P>怎么控制这个图上下左右移动啊,我画图的程序在这里</P> <P><BR>Option Explicit<BR><BR>Dim Poly As MapObjects2.Polygon<BR>Dim Pts As MapObjects2.Points</P> <P>Private Sub Command1_Click()<BR> Dim p As Point<BR> Set Rect1 = New MapObjects2.Rectangle<BR> Set Poly = New MapObjects2.Polygon<BR> Set Pts = New MapObjects2.Points<BR> Dim a As Integer<BR> Dim b As Integer<BR> a = 10000<BR> b = 7000<BR> Set p = Map1.ToMapPoint(a, b)<BR> Pts.Add p<BR> Set p = Map1.ToMapPoint(a + 60, b + 140)<BR> Pts.Add p<BR> Set p = Map1.ToMapPoint(a + 190, b + 270)<BR> Pts.Add p<BR> Set p = Map1.ToMapPoint(a + 260, b + 180)<BR> Pts.Add p<BR> Set p = Map1.ToMapPoint(a + 160, b + 100)<BR> Pts.Add p<BR> Set p = Map1.ToMapPoint(a, b)<BR> Pts.Add p<BR> Poly.Parts.Add Pts<BR> Set Pts = Poly.Parts(0)<BR> Map1.Refresh<BR> <BR>End Sub</P> <P><BR> </P> <P>Private Sub Map1_AfterTrackingLayerDraw(ByVal hDC As stdole.OLE_HANDLE)<BR> If Not Poly Is Nothing Then<BR> If Pts.Count > 1 Then<BR> Dim sym As New Symbol<BR> sym.Color = moRed<BR> sym.SymbolType = moFillSymbol<BR> sym.Size = 2<BR> Map1.DrawShape Poly, sym<BR> End If<BR> End If<BR>End Sub</P> |
|