Deklaration: Declare Function CreateBrushIndirect Lib "gdi32" ( _ lpLogBrush As LOGBRUSH) As Long Beschreibung: Parameter:
Rückgabewert: Beispiel: Private Declare Function CreateBrushIndirect Lib "gdi32" ( _ lpLogBrush As LOGBRUSH) As Long Private Declare Function SelectObject Lib "gdi32" ( _ ByVal hdc As Long, _ ByVal hObject As Long) As Long Private Declare Function DeleteObject Lib "gdi32" ( _ ByVal hObject As Long) As Long Private Declare Function PatBlt Lib "gdi32" ( _ ByVal hdc As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal dwRop As Long) As Long Private Type LOGBRUSH lbStyle As Long lbColor As Long lbHatch As Long End Type ' LOGBRUSH lbStyle-Konstanten Private Const BS_HATCHED = 2 ' Gemusterter Brush Private Const BS_NULL = 1 ' Leerer Brush Private Const BS_SOLID = 0 ' Solider Brush ' LOGBRUSH lbHatch-Konstanten Private Const HS_BDIAGONAL = 3 ' Diagonal von links unten nach rechts oben (/) Private Const HS_CROSS = 4 ' Kreuz (+) Private Const HS_DIAGCROSS = 5 ' Diagonales Kreuz (x) Private Const HS_FDIAGONAL = 2 ' Diagonal von rechts unten nach links oben (\) Private Const HS_HORIZONTAL = 0 ' Horizontal (-) Private Const HS_VERTICAL = 1 ' Vertikal (|) ' PatBlt dwRop-Konstanten Private Const PATCOPY = &HF00021 ' Kopiert den Brush auf das Ziel Private Const PATINVERT = &H5A0049 ' Kopiert den Brush invertiert auf das Ziel Private Const DSTINVERT = &H550009 ' Invertiert das Ziel und Kopiert den Brush darauf Private Const BLACKNESS = &H42 ' Das Ziel wird mit Schwarz und dann mit dem Brush gefüllt Private Const WHITENESS = &HFF0062 ' Das Ziel wird mit Weiß und dann mit dem Brush gefüllt ' Zeichnen eines gemusterten Rechtecks auf die Form Private Sub Form_Load() Dim Retval As Long, hBrush As Long, hOldBrush As Long, LB As LOGBRUSH Me.AutoRedraw = True Me.ScaleMode = vbPixels ' Brush erstellen With LB .lbColor = vbGreen .lbHatch = HS_DIAGCROSS .lbStyle = BS_HATCHED End With hBrush = CreateBrushIndirect(LB) ' Brush der Form zuweisen und Ergebnis (Alter Brush) zwischenspeichern hOldBrush = SelectObject(Me.hdc, hBrush) ' Rechteck zeichnen Retval = PatBlt(Me.hdc, 10, 10, Me.ScaleWidth - 20, Me.ScaleHeight - _ 20, PATINVERT) ' Alten Brush wiederherstellen Call SelectObject(Me.hdc, hOldBrush) ' erstellten Brush zerstören Call DeleteObject(hBrush) End Sub Diese Seite wurde bereits 6.643 mal aufgerufen. |
vb@rchiv CD Vol.6 Geballtes Wissen aus mehr als 8 Jahren vb@rchiv! Online-Update-Funktion Entwickler-Vollversionen u.v.m. Buchempfehlung Tipp des Monats Mai 2024 Hermann Röttger Wochentage eines Datumsbereichs ermitteln Wochentage eines Datumsbereichs ermitteln, optional mit Feiertagsberechnung 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 :-) |
||||||||||||
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. |