cs_sirene2005
Messages postés16Date d'inscriptionmardi 18 octobre 2005StatutMembreDernière intervention25 août 2006
-
8 août 2006 à 13:38
cs_claudetom
Messages postés115Date d'inscriptionjeudi 11 octobre 2001StatutMembreDernière intervention15 octobre 2012
-
16 oct. 2012 à 20:29
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.
cs_claudetom
Messages postés115Date d'inscriptionjeudi 11 octobre 2001StatutMembreDernière intervention15 octobre 2012 16 oct. 2012 à 20:29
Ajout coins en biseaux !
vous lui passez le rectangle et retourne la figure (Path)
suffit d'ajouter une condition au début de la function ToGraphicsPath
exemple une propriété choix (rounded/Ligne)
Public Function AddAnglesCorners(ByVal BaseRect As RectangleF) As GraphicsPath
Dim MyPath As New Drawing2D.GraphicsPath()
Dim points(7) As Point
'TopLeft
points(0) = New Point(CInt(BaseRect.Left + RoundedCorner.TopLeft), CInt(BaseRect.Top))
'TopRight
points(1) = New Point(CInt(BaseRect.Right - RoundedCorner.TopRight), CInt(BaseRect.Top))
points(2) = New Point(CInt(BaseRect.Right), CInt(BaseRect.Top + RoundedCorner.TopRight))
'BottomRight
points(3) = New Point(CInt(BaseRect.Right), CInt(BaseRect.Bottom - RoundedCorner.BottomRight))
points(4) = New Point(CInt(BaseRect.Right - RoundedCorner.BottomRight), CInt(BaseRect.Bottom))
'BottomLeft
points(5) = New Point(CInt(BaseRect.Left + RoundedCorner.BottomLeft), CInt(BaseRect.Bottom))
points(6) = New Point(CInt(BaseRect.Left), CInt(BaseRect.Bottom - RoundedCorner.BottomLeft))
'TopLeft
points(7) = New Point(CInt(BaseRect.Left), CInt(BaseRect.Top + RoundedCorner.TopLeft))
With MyPath
.AddLines(points)
.CloseFigure()
End With
Return MyPath
End Function
cs_eldim
Messages postés956Date d'inscriptionlundi 30 mai 2005StatutMembreDernière intervention21 août 20141 16 oct. 2012 à 20:12
Bonjour,
remplace les draw arc par des fonctions de dessin de ton choix
cs_claudetom
Messages postés115Date d'inscriptionjeudi 11 octobre 2001StatutMembreDernière intervention15 octobre 2012 15 oct. 2012 à 23:19
Bonjour question peut-être bête ?
Mais je cherche la même chose sauf que les coins au lieu d’être arrondis, je les veux en biseaux en fonction de la valeur RoundedCorner
TopLeft,TopRight,BottomLeft,BottomRight.
en utilisant biensure toujours GraphicsPath
Merci
cs_mic
Messages postés77Date d'inscriptionmardi 5 février 2002StatutMembreDernière intervention19 septembre 2012 19 sept. 2012 à 18:50
Merci d'avoir mi ce code en ligne
andreafar
Messages postés1Date d'inscriptionmardi 3 août 2010StatutMembreDernière intervention22 août 2010 22 août 2010 à 14:30
Super. Elle marche très bien chez moi.
cs_sirene2005
Messages postés16Date d'inscriptionmardi 18 octobre 2005StatutMembreDernière intervention25 août 2006 8 août 2006 à 13:38
votre programme est bon mais si tu enrichie avec d'autre forme
bon courage
16 oct. 2012 à 20:29
vous lui passez le rectangle et retourne la figure (Path)
suffit d'ajouter une condition au début de la function ToGraphicsPath
exemple une propriété choix (rounded/Ligne)
Public Function AddAnglesCorners(ByVal BaseRect As RectangleF) As GraphicsPath
Dim MyPath As New Drawing2D.GraphicsPath()
Dim points(7) As Point
'TopLeft
points(0) = New Point(CInt(BaseRect.Left + RoundedCorner.TopLeft), CInt(BaseRect.Top))
'TopRight
points(1) = New Point(CInt(BaseRect.Right - RoundedCorner.TopRight), CInt(BaseRect.Top))
points(2) = New Point(CInt(BaseRect.Right), CInt(BaseRect.Top + RoundedCorner.TopRight))
'BottomRight
points(3) = New Point(CInt(BaseRect.Right), CInt(BaseRect.Bottom - RoundedCorner.BottomRight))
points(4) = New Point(CInt(BaseRect.Right - RoundedCorner.BottomRight), CInt(BaseRect.Bottom))
'BottomLeft
points(5) = New Point(CInt(BaseRect.Left + RoundedCorner.BottomLeft), CInt(BaseRect.Bottom))
points(6) = New Point(CInt(BaseRect.Left), CInt(BaseRect.Bottom - RoundedCorner.BottomLeft))
'TopLeft
points(7) = New Point(CInt(BaseRect.Left), CInt(BaseRect.Top + RoundedCorner.TopLeft))
With MyPath
.AddLines(points)
.CloseFigure()
End With
Return MyPath
End Function
16 oct. 2012 à 20:12
remplace les draw arc par des fonctions de dessin de ton choix
15 oct. 2012 à 23:19
Mais je cherche la même chose sauf que les coins au lieu d’être arrondis, je les veux en biseaux en fonction de la valeur RoundedCorner
TopLeft,TopRight,BottomLeft,BottomRight.
en utilisant biensure toujours GraphicsPath
Merci
19 sept. 2012 à 18:50
22 août 2010 à 14:30
8 août 2006 à 13:38
bon courage