SAUVEGARDER UNE IMAGE ET UN GRAPHICS
Bonjour
Je dois faire un programme avec un scanner.
J'arrive à scanner mais sur l'image l'utilisateur doit faire des modifications, du genre surlignage annotations etc...
L'image est dans une picturebox sur laquelle j'ai associé un objet graphics pour les modifs tous s'affiche mais au moment de la sauvegarde de l'image je n'ai que l'image original sans le graphics.
Je voudrais savoir si il y a moyen de sauvegarder le tout ou de passer par autre chose que l'objet graphics
Exemple
ci j'insère un texte avec l'objet Graphics
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
Private Sub Picture1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Picture1.MouseUp
up = New Point(e.Y, e.Y)
r = New Rectangle(down.X, down.Y, up.X - down.X, up.Y - down.Y)
If Stylo.Checked = True Then
Dim s As String
s = InputBox("Votre Texte", "Texte à afficher")
g_PB.DrawString(s, New Font("Arial", 10), Brushes.Black, down.X, down.Y)
g.DrawString(s, New Font("Arial", 10), Brushes.Black, down.X, down.Y)
End If |
Ici je fait la sauvegarde
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
Private Sub Sauver_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sauver.Click
SFD.Title = "Sauvegarde de l'image"
SFD.InitialDirectory = "c:\"
SFD.Filter = "Fichier PNG (*.png)|*.png"
If SFD.ShowDialog = Windows.Forms.DialogResult.OK Then
'bmp.Save("tmp.gif", System.Drawing.Imaging.ImageFormat.Jpeg)
bmp.Save(SFD.FileName, System.Drawing.Imaging.ImageFormat.Png)
End If
End Sub |
Merci d'avance