You can also create your own photo effects by manipulating the bits themselves. Here's an example where the photo is distorted by moving pixels gradually to a new position in the photograph.
Dim myImage As Bitmap = _
New Bitmap("C:\zion.jpg", True)
Dim x, y, i As Integer
Dim myImageColor As Color
i = 0
For y = 0 To myImage.Height - 1
i += 1
For x = 0 To myImage.Width - 1
If x + i < myImage.Width Then
myImageColor = myImage.GetPixel(x + i, y)
Else
myImageColor = myImage.GetPixel(x, y)
End If
myImage.SetPixel(x, y, myImageColor)
Next
Next
PictureBox.Image = myImage
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
And here's a "fade to black" effect created by changing the color of the pixels themselves.
Dim myImage As Bitmap = _
New Bitmap("C:\zion.jpg", True)
Dim x, y As Integer
Dim newColor As Color
Dim pixelColor As Color
For y = 0 To myImage.Height - 1
For x = 0 To myImage.Width - 1
pixelColor = myImage.GetPixel(x, y)
If pixelColor.R - x > 0 _
And pixelColor.G - x > 0 _
And pixelColor.B - x > 0 Then
newColor = _
Color.FromArgb(255, _
pixelColor.R - x, _
pixelColor.G - x, _
pixelColor.B - x)
Else
newColor = _
Color.FromArgb(255, 0, 0, 0)
End If
myImage.SetPixel(x, y, newColor)
Next
Next
PictureBox.Image = myImage
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------

