1 2 3 4 5 6 7 8 9 10 11 12
|
iSource = System.Drawing.Image.FromFile(textBox1.Text)
bmpFinal = New System.Drawing.Bitmap(iSource, iSource.Width, iSource.Height)
g = Graphics.FromImage(bmpFinal)
Dim drawFont As Font = New Font("Arial", 12)
g.SmoothingMode = SmoothingMode.HighQuality
g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
Dim drawFormat As StringFormat = New StringFormat
g.DrawImage(bmpFinal, 0, 0, bmpFinal.Width, bmpFinal.Height)
g.DrawString(textBox2.Text, drawFont, Brushes.Black, 0, 0, drawFormat)
bmpFinal.Save("c:\test.jpeg", ImageFormat.Jpeg)
MessageBox.Show("Image c:\test.jepg générée avec succès") |
Partager