Hi!
Weiss jemand wie ich die Hintergrundfarbe, Strichart, -stärke und -farbe ändern kann?
Wieso wird die Ellipse nicht genau bei den Mauskoordinaten gezeichnet?
Vielen Dank schonmal für eure Hilfe!
MfG, Andi
Private Declare Function Ellipse Lib "gdi32.dll" (ByVal hDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Dim DrawFlag As Boolean
Dim e\_X1 As Integer
Dim e\_X2 As Integer
Dim e\_Y1 As Integer
Dim e\_Y2 As Integer
Private Sub Image1\_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
DrawFlag = True
e\_X1 = X
e\_Y1 = Y
End Sub
Private Sub Image1\_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If DrawFlag = True Then
Me.Repaint
e\_X2 = X
e\_Y2 = Y
Dim hWnd As Long
Dim hDC As Long
hWnd = FindWindow(vbNullString, Me.Caption)
hDC = GetDC(hWnd)
Ellipse hDC, e\_X1, e\_Y1, e\_X2, e\_Y2
End If
End Sub
Private Sub Image1\_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If DrawFlag = True Then
DrawFlag = False
End If
End Sub
[MOD] Pre-Tag eingefügt.