Salut j'ai un problème pour dessiner des points dans un PictureBox et avec la fonction RectangleF.
Je ne peux utiliser la fonction Rectangle (ca donne des Integer) je dois absolument utiliser la fonction RectangleF, qui donne des Single.
Stéphanne33 m'a dit:
Au niveau précision c'est clair, mais là pour ta représentation graphique, soit tu fais du Plein avec Rectangle, soit tu fais vide avec RectangleF et DrawEllipse
Daccord, mais je ne saisi pas comment faire pour régler mon problème...
Si quelqu'un peut modifier le code afin que ca fonctionne...
Je suis désespéré
Merci d'avance
Private
Sub
BtnCercle_Click(
ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
cmdDessin.Click
Dim
objBitMap
As
New
Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim
objGraphics
As
Graphics
Dim
MonRectableF
As
RectangleF
Dim
MaBrush
As
Brush
Dim
i
As
Integer
Dim
CoordX
As
Single
, CoordY
As
Single
objGraphics = Graphics.FromImage(objBitMap)
objGraphics.Clear(Color.White)
MaBrush =
New
SolidBrush(Color.Blue)
For
i = 0
To
UBound(Tableau)
LigneSplit = Tableau(i).Split(Separateur)
CoordX = ((Convert.ToDouble(LigneSplit(2)) + 5000) / 1000)
CoordY = ((Convert.ToDouble(LigneSplit(1)) + 5000) / 1000)
MonRectableF =
New
RectangleF(CoordX, CoordY, 10, 10)
objGraphics.FillEllipse(MaBrush, MonRectableF) 'Erreur = Value of type 'System.Drawing.RectangleF' cannot be converted to 'System.Drawing.Rectangle'
Next
i
Me
.PictureBox1.Image = objBitMap
objGraphics.Dispose()
objGraphics =
Nothing
End
Sub