Bonjour,

J'ai cherché comment écrire un texte sur une image, et j'ai trouvé le code source suivant: http://dotnet.developpez.com/sources...e=MM#Watermark

Mais comment on peut rendre ce texte transparent ?

Voilà une partie de ce code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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")
Et merci d'avance.