Bonjour,

Je suis une débutante en programmation, et j'utilise visual studio 2010 express.
Je suis en train de créer un logiciel de dessin ( très basique ) et je suis bloqué pour enregistrer une image. Voici mon code (en complet) :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Public Class Form1
    Dim down = False
    Dim myBrush As System.Drawing.SolidBrush = New System.Drawing.SolidBrush(Color.Black)
    Dim taille As Integer = 15
    Private Sub PictureBox1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
        down = True
    End Sub
 
    Private Sub PictureBox1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
        If down = True Then
            PictureBox1.CreateGraphics.FillEllipse(myBrush, e.X, e.Y, taille, taille)
        End If
    End Sub
 
    Private Sub PictureBox1_MouseUp(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
        down = False
    End Sub
 
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        myBrush.Color = Color.White
    End Sub
 
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            myBrush.Color = ColorDialog1.Color
        End If
    End Sub
 
    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
        taille = Int(TextBox1.Text)
    End Sub
 
    Private Sub EffacerToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EffacerToolStripMenuItem.Click
        PictureBox1.Image = Nothing
    End Sub
 
    Private Sub QuitterToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles QuitterToolStripMenuItem.Click
        End
    End Sub
 
    Private Sub OuvrirToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OuvrirToolStripMenuItem.Click
        If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            PictureBox1.Load(OpenFileDialog1.FileName)
        End If
    End Sub
    Private Sub Form_Load()
 
    End Sub
 
    Private Sub EnregistrerToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EnregistrerToolStripMenuItem.Click
 
    End Sub
 
 
 
End Class




Merci.