Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- btnOk.Enabled = False
- chkStop.Focus()
- Dim bmap As New Bitmap(picEmboss.Image)
- picEmboss.Image = bmap
- 'Needed variables
- Dim tempbmp As New Bitmap(picEmboss.Image)
- Dim i, j As Integer
- Dim DispX As Integer = 1, DispY As Integer = 1
- Dim red, green, blue As Integer
- Static former As Integer = 0 'first time it is run,its value is zero
- 'So, we go across the image matrix, pixel by pixel
- Static Former_i As Integer = 0
- With tempbmp
- For i = Former_i To .Height - 2
- For j = 0 To .Width - 2
- Dim pixel1, pixel2 As System.Drawing.Color
- pixel1 = .GetPixel(j, i)
- pixel2 = .GetPixel(j + DispX, i + DispY)
- red = Math.Min(Math.Abs(CInt(pixel1.R) - CInt(pixel2.R)) + 128, 255)
- green = Math.Min(Math.Abs(CInt(pixel1.G) - CInt(pixel2.G)) + 128, 255)
- blue = Math.Min(Math.Abs(CInt(pixel1.B) - CInt(pixel2.B)) + 128, 255)
- bmap.SetPixel(j, i, Color.FromArgb(red, green, blue))
- Next
- Next
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment