title image


Smiley Dreieck gefällig ...
Private Declare Function CreatePolygonRgn Lib "gdi32" _

(lpPoint As Any, ByVal nCount As Long, _

ByVal nPolyFillMode As Long) As Long



Private Declare Function Polygon Lib "gdi32" _

(ByVal hdc As Long, lpPoint As Any, _

ByVal nCount As Long) As Long



Private Declare Function FillRgn Lib "gdi32" _

(ByVal hdc As Long, ByVal hRgn As Long, _

ByVal hBrush As Long) As Long



Private Declare Function GetStockObject Lib "gdi32" _

(ByVal nIndex As Long) As Long



Private Declare Function DeleteObject Lib "gdi32" _

(ByVal hObject As Long) As Long



Private Type COORD

x As Long

y As Long

End Type



Const ALTERNATE = 1

Const WINDING = 2

Const BLACKBRUSH = 4





Private Sub Form_Paint()

Dim poly(1 To 3) As COORD

Dim NumCoords As Long

Dim hBrush As Long

Dim hRgn As Long



Me.Cls

NumCoords = 3

Me.ScaleMode = vbPixels



'Polygon erstellen

poly(1).x = Form1.ScaleWidth / 2

poly(1).y = Form1.ScaleHeight / 2

poly(2).x = Form1.ScaleWidth / 4

poly(2).y = 3 * Form1.ScaleHeight / 4

poly(3).x = 3 * Form1.ScaleWidth / 4

poly(3).y = 3 * Form1.ScaleHeight / 4



'Polygon füllen

Polygon Me.hdc, poly(1), NumCoords

hBrush = GetStockObject(BLACKBRUSH)

hRgn = CreatePolygonRgn(poly(1), NumCoords, ALTERNATE)

If hRgn Then FillRgn Me.hdc, hRgn, hBrush

DeleteObject hRgn

End Sub



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: