Deklaration: Declare Function CreateEllipticRgn Lib "gdi32.dll" ( _ ByVal X1 As Long, _ ByVal Y1 As Long, _ ByVal X2 As Long, _ ByVal Y2 As Long) As Long Beschreibung: Parameter:
Rückgabewert: Beispiel: Private Declare Function CreateEllipticRgn Lib "gdi32.dll" ( _ ByVal X1 As Long, _ ByVal Y1 As Long, _ ByVal X2 As Long, _ ByVal Y2 As Long) As Long Private Declare Function DeleteObject Lib "gdi32.dll" ( _ ByVal hObject As Long) As Long Private Declare Function CreateRectRgn Lib "gdi32.dll" ( _ ByVal X1 As Long, _ ByVal Y1 As Long, _ ByVal X2 As Long, _ ByVal Y2 As Long) As Long Private Declare Function CombineRgn Lib "gdi32" ( _ ByVal hDestRgn As Long, _ ByVal hSrcRgn1 As Long, _ ByVal hSrcRgn2 As Long, _ ByVal nCombineMode As Long) As Long Private Declare Function FrameRgn Lib "gdi32.dll" ( _ ByVal hdc As Long, _ ByVal hRgn As Long, _ ByVal hBrush As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long) As Long Private Declare Function CreateHatchBrush Lib "gdi32.dll" ( _ ByVal nIndex As Long, _ ByVal crColor As Long) As Long Private Declare Function FillRgn Lib "gdi32.dll" ( _ ByVal hdc As Long, _ ByVal hRgn As Long, _ ByVal hBrush As Long) As Long Private Declare Function InvertRgn Lib "gdi32.dll" ( _ ByVal hdc As Long, _ ByVal hRgn As Long) As Long ' CreateHatchBrush nIndex-Konstanten Private Const HS_BDIAGONAL = 3 Private Const HS_CROSS = 4 Private Const HS_DIAGCROSS = 5 Private Const HS_FDIAGONAL = 2 Private Const HS_HORIZONTAL = 0 Private Const HS_VERTICAL = 1 Private hRgn1 As Long, hRgn2 As Long, hRgn3 As Long Private hBrush As Long ' 2 Regionen kombinieren und invertieren Private Sub Form_Load() Dim Retval As Long ' Autoredraw auf True stellen Me.AutoRedraw = True ' Brush erstellen hBrush = CreateHatchBrush(HS_DIAGCROSS, RGB(0, 255, 0)) ' Elliptische Region erstellen hRgn1 = CreateEllipticRgn(20, 30, 150, 110) ' bounding rectangle (20,30)-(150,110) ' daneben eine rechteckige Region erstellen hRgn2 = CreateRectRgn(150, 30, 200, 110) ' eine dritte "leere" Region erstellen hRgn3 = CreateRectRgn(0, 0, 0, 0) ' kombinieren der beiden Regionen (Körper) zu einer Region CombineRgn hRgn3, hRgn1, hRgn2, 3 ' kombinierte Region mit dem Brush füllen FillRgn Me.hdc, hRgn3, hBrush ' invertieren der kombinierten Region InvertRgn Me.hdc, hRgn3 ' Rahmen mit dem Pen um die kombinierte Region zeichnen FrameRgn Me.hdc, hRgn3, hBrush, 5, 10 End Sub ' Ressourcen freigeben Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Dim Retval As Long ' löschen des Brushs DeleteObject hBrush ' löschen der erstellten Regionen DeleteObject hRgn1 DeleteObject hRgn2 DeleteObject hRgn3 End Sub Diese Seite wurde bereits 7.809 mal aufgerufen. |
sevWizard für VB5/6 Professionelle Assistenten im Handumdrehen Erstellen Sie eigene Assistenten (Wizards) im Look & Feel von Windows 2000/XP - mit allem Komfort und zwar in Windeseile :-) Buchempfehlung Tipp des Monats April 2024 Skyfloy Chart von Microsoft und dazu noch gratis Tutorial für Microsoft Chart Controls für Microsoft .NET Framework 3.5 TOP Entwickler-Paket TOP-Preis!! Mit der Developer CD erhalten Sie insgesamt 24 Entwickler- komponenten und Windows-DLLs. Die Einzelkomponenten haben einen Gesamtwert von 1605.50 EUR... |
||||||||||||||||||
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein. |