peug
Messages postés232Date d'inscriptionmercredi 25 octobre 2000StatutMembreDernière intervention 5 octobre 2012
-
24 déc. 2008 à 16:01
PCPT
Messages postés13272Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 2018
-
24 déc. 2008 à 18:06
Salut !
Est-il possible de créer un rectangle de couleur plein avec des hachures en plus ? fond jaune et hachure rouge par exemple sans devoir dessiner 2 rectangles supersposés ?
pour info voici ma procédure de dessin :
Public Sub DrawRectangle(ByRef hDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal lWidth As Long, ByVal lheight As Long, _
ByVal lBackColor As Long, ByVal ColorLine As Long, ByVal Round As Long, ByVal lStyle As FillStyleConstants, _ Optional ByVal BordGras As Integer 0, Optional ByVal DoRadio As Boolean True)
Dim hBrush As Long
Dim hOldBrush As Long
Dim retval As Long
Dim R As Long
Dim g As Long
Dim B As Long
Dim hPen As Long
Dim hOldPen As Long
Dim lColor As Long
Dim lColorLine As Long
Dim tR As RECT
R = (lColor And &HFF&)
g = (lColor And &HFF00&) \ &H100&
B = (lColor And &HFF0000) \ &H10000
If lStyle = vbFSSolid Then
hBrush = CreateSolidBrush(RGB(R, g, B))
ElseIf lStyle = vbFSTransparent Then
hBrush = GetStockObject(SO_NULL_BRUSH)
Else
hBrush = CreateHatchBrush(lStyle - 2, RGB(R, g, B))
End If
hOldBrush = SelectObject(hDC, hBrush)
R = (lColorLine And &HFF&)
g = (lColorLine And &HFF00&) \ &H100&
B = (lColorLine And &HFF0000) \ &H10000
hPen = CreatePen(PS_INSIDEFRAME, BordGras, RGB(R, g, B))
hOldPen = SelectObject(hDC, hPen)
PCPT
Messages postés13272Date d'inscriptionlundi 13 décembre 2004StatutMembreDernière intervention 3 février 201847 24 déc. 2008 à 18:06
peut-être plutôt avec CreateBrushIndirect pour avoir le même code et 2 Flags différents mais sinon pourquoi pas
surtout ne pas oublier de libérer
++, bonne fêtes