VB Code:
Option Explicit
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Private Sub Form_Load()
Picture1.Picture = LoadPicture("c:\a.bmp")
Me.Show
HalfFadeToWhite Picture1
End Sub
Private Sub HalfFadeToWhite(destPic As PictureBox)
Dim i As Long, j As Long, col As Long
Dim colwhite As Long, colRed As Long, colGreen As Long, colBlue As Long
colwhite = RGB(255, 255, 255)
destPic.Visible = False
For i = 0 To destPic.ScaleWidth
For j = 0 To destPic.ScaleHeight
col = GetPixel(destPic.hdc, i, j)
colRed = ((col Mod 256) + 255) / 2
colGreen = ((((col And &HFF00) / 256&) Mod 256&) + 255) / 2
colBlue = (((col And &HFF0000) / 65536) + 255) / 2
SetPixel destPic.hdc, i, j, RGB(colRed, colGreen, colBlue)
Next
Next
destPic.Visible = True
destPic.Refresh
End Sub