Dim bm As New Bitmap(pbAfter.Image)
'grayscale
Dim X As Integer
Dim Y As Integer
Dim clr As Integer
For X = 0 To bm.Width - 1
For Y = 0 To bm.Height - 1
clr = (CInt(bm.GetPixel(X, Y).R) + _
bm.GetPixel(X, Y).G + _
bm.GetPixel(X, Y).B) \ 3
bm.SetPixel(X, Y, Color.FromArgb(clr, clr, clr))
Next Y
Next X
pbAfter.Image = bm
End Sub
huma_huma 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.