slt
voila le code by BLACKOFUIL
' on charge la matrice inverse couleur
matrix = (New ColorMatrix(New Single()() _
{New Single() {-1.0, 0.0, 0.0, 0, 0}, _
New Single() {0.0, -1.0, 0.0, 0, 0}, _
New Single() {0.0, 0.0, -1.0, 0, 0}, _
New Single() {0, 0, 0, 1.0, 0}, _
New Single() {1.0, 1.0, 1.0, 0, 0.0}}))
' et pour noir est blanc
matrix = (New ColorMatrix(New Single()() _
{New Single() {0.3, 0.3, 0.3, 0, 0}, _
New Single() {0.59, 0.59, 0.59, 0, 0}, _
New Single() {0.11, 0.11, 0.11, 0, 0}, _
New Single() {0, 0, 0, 1.0, 0}, _
New Single() {0.0, 0.0, 0.0, 0, 1.0}}))
' pour sepia
matrix = (New ColorMatrix(New Single()() _
{New Single() {0.393, 0.349, 0.272, 0, 0}, _
New Single() {0.769, 0.686, 0.534, 0, 0}, _
New Single() {0.189, 0.168, 0.131, 0, 0}, _
New Single() {0, 0, 0, 1.0, 0}, _
New Single() {0.0, 0.0, 0.0, 0, 1.0}}))
' a vous de choisir la matrice que vous voulez
Dim cheminsource As String 'chemin complet
'chemin de l'image '
cheminsource = "pictures" + Label2.Text + ".jpg"
Dim image1 As Bitmap
image1 = New Bitmap(cheminsource, True)
' résultats picturebox
Using DestBmp As Bitmap = image1
Using IAttributes As New ImageAttributes
Using G As Graphics = Graphics.FromImage(DestBmp)
IAttributes.SetColorMatrix(matrix) 'on applique les données de la matrice
G.DrawImage(DestBmp, New Rectangle(0, 0, DestBmp.Width, DestBmp.Height), _
0, 0, DestBmp.Width, DestBmp.Height, GraphicsUnit.Pixel, IAttributes)
'ton picturebox'
PictureBox2.Image =CType(DestBmp.Clone,Image)
End Using
End Using
End Using