Code: Select all
Public Sub DRW_1_Draw()
Dim x, y As Integer
x = DRW_1.Width / 2
y = DRW_1.Height / 2
With Paint
' Draw Filled Center
.brush = Paint.Color(&hffff00)
.MoveTo(x, y - 90)
.LineTo(x - 20, y + 10)
.LineTo(x, y + 40)
.LineTo(x + 20, y + 10)
.LineTo(x, y - 90)
.fill
' Draw Outlin
.brush = Paint.Color(&h0000FF)
.MoveTo(x, y - 90)
.LineTo(x - 20, y + 10)
.LineTo(x, y + 40)
.LineTo(x + 20, y + 10)
.LineTo(x, y - 90)
.stroke
' Finish Drawing
.End
End With
End
A better way would be to consider the rotational pivot point to be (0,0) for the object, then determine the coordinates of the pointer and define it as some kind of shape... drop the shape where I want it and at the desired rotation.
I see the PrintMatrix and I'm wondering if that would work... but I cannot seem to figure it out. Can someone help me?
Assumptions:
- The Drawing Area is named DRW_1
- The center of rotation will be (DRW_1.Width/2 [, DRW_1.Height/2)
- For now Slider_1 will be set from -360 to +360 and will be applied as the rotational angle.
- If angle is specified as degrees, it will be Slider_1.value
- If angle is specified a radians, it will be RAD(Slider_1.value)
Thanks,
Jerry