Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Const wd = 200
Const ht = 200
Dim colr As Color
Dim img As Image = Image.FromFile("c:\A\faalogo.jpg")
Dim bm0 As Bitmap = New Bitmap(img, wd, ht)
Dim bm1 As Bitmap = New Bitmap(wd, ht)
Dim bm2 As Bitmap = New Bitmap(wd, ht)
Dim bm3 As Bitmap = New Bitmap(wd, ht)
Dim xx, yy As Integer
Dim rr1, gg1, bb1, rr2, gg2, bb2 As Byte
Try
e.Graphics.DrawImage(bm0, 0, wd) ' original
For yy = 1 To ht - 1
For xx = 1 To wd - 1
Application.DoEvents()
colr = bm0.GetPixel(xx, yy)
rr1 = Not colr.R
bb1 = Not colr.B
gg1 = Not colr.G
rr2 = colr.R / 2
gg2 = colr.G / 2
bb2 = colr.B / 2
bm1.SetPixel(xx, yy, Color.FromArgb(255, rr1, gg1, bb1))
bm2.SetPixel(xx, yy, Color.FromArgb(255, rr2, gg2, bb2))
bm3.SetPixel(xx, yy, Color.FromArgb(255, colr.B, colr.G, colr.R))
e.Graphics.DrawImage(bm1, 0, 0)
e.Graphics.DrawImage(bm2, ht, wd)
e.Graphics.DrawImage(bm3, ht, 0)
Next xx
Next yy
Catch ee As Exception
MsgBox(ee.Message)
End Try
End Sub