Hi

This looked like it could be a pretty good way to swap colors but I'm not able to extract the RGB components from the bits. Any help or suggestions would be really appreciated.

vb code:

Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Dim PicBits() As Byte, PicInfo As BITMAP
Dim Cnt As Long, BytesPerLine as Long
Private Sub Command1_Click()

GetObject Picture1.Image, Len(PicInfo), PicInfo
BytesPerLine = (PicInfo.bmWidth * 3 + 3) And &HFFFFFFFC
ReDim PicBits(1 To BytesPerLine * PicInfo.bmHeight * 3) As Byte
GetBitmapBits Picture1.Image, UBound(PicBits), PicBits(1)
For Cnt = 1 To UBound(PicBits)
PicBits(Cnt) = 'How do I get and assign RGB colors here from PicBits(Cnt) ?
Next Cnt
SetBitmapBits Picture1.Image, UBound(PicBits), PicBits(1)
Picture1.Refresh
End Sub