Dim myBitmap1 As Bitmap = PictureBox1.Image
Dim myBitmap2 As New Bitmap(myBitmap1.Width, myBitmap1.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb)
For ii = 1 To PictureBox1.Width - 2
For jj = 1 To PictureBox1.Height - 2
Dim Win = 0
Dim Mean = 0
For X = ii - 1 To (ii + 1)
For Y = jj - 1 To (jj + 1)
Win = Win + (System.Drawing.ColorTranslator.ToWin32(myBitmap1.GetPixel(X, Y)))
Next Y
Next X
Mean = (Win \ 11)
Dim r = Mean Mod 256
Dim g = ((Mean And &HFF00FF00) / 256&)
Dim b = ((Mean And &HFF0000) / 65536)
myBitmap2.SetPixel(ii, jj, Color.FromArgb(r, g, b))
PictureBox2.Image = myBitmap2
Next jj
Next ii
TextBox1.Visible = True
TextBox1.Text = "Mean Filter"
What I have tried:
I don't know where is the problem?? i need a help ??????????