最好能给源码提示。谢了

解决方案 »

  1.   

    能不能详细一点? 是不是 画一个指南针图片? 那使用image 或者picturebox 就可以了
      

  2.   

    如果是简单的指针图形,算出坐标,用Line函数画就可以了,可以放在PictureBox里,移动的时候,设置PictureBox的DrawMode = 7,在原位置重画即可擦掉原图
      

  3.   

    给你源码,我做的是仪表,不过差不多.(在窗体上放个picturebox空间,我名称为picspeed,函数的参数是要转的角度.
    Private Sub YiBiao(ByVal lcs As Double)
    Dim x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long, x4 As Long, y4 As Long, temp As LongDim yuan
    picSpeed.ScaleMode = 3
    picSpeed.AutoRedraw = TrueIf lcs < 0 Then lcs = 0
    If lcs > 180 Then lcs = 180
    lcs = lcs * 24 / 18 - 30x1 = picSpeed.ScaleWidth / 2
    y1 = picSpeed.ScaleHeight / 2
    x2 = x1 + picSpeed.ScaleHeight / 2.5 * Cos((180 + lcs) * 3.14 / 180)
    y2 = y1 + picSpeed.ScaleHeight / 2.5 * Sin((180 + lcs) * 3.14 / 180)
    x3 = x1 + picSpeed.ScaleWidth / 50 * Cos((90 + lcs) * 3.14 / 180)
    y3 = y1 + picSpeed.ScaleWidth / 50 * Sin((90 + lcs) * 3.14 / 180)
    x4 = x1 + picSpeed.ScaleWidth / 50 * Cos((270 + lcs) * 3.14 / 180)
    y4 = y1 + picSpeed.ScaleWidth / 50 * Sin((270 + lcs) * 3.14 / 180)
    picSpeed.Cls
    midX = ((x3 + x4) / 2 + x2) / 2
    midY = ((y3 + y4) / 2 + y2) / 2
    picSpeed.Line (x2, y2)-(x3, y3), QBColor(10)
    picSpeed.Line (x2, y2)-(x4, y4), QBColor(10)
    picSpeed.Line (x3, y3)-(x4, y4), QBColor(10)picSpeed.Circle (x1, y1), picSpeed.ScaleWidth / 25, QBColor(8)
    picSpeed.FillColor = QBColor(8)ExtFloodFill picSpeed.hdc, x1, y1, picSpeed.Point(x1, y1), 1
    End Sub