Hi,
I'm a beginner in VB and i need to complete one task to list out all the RGB values from the .BMP image file. I have no idea how to do this coz i'm not familiar in Vb before.
Hopefully someone can help me.
Regards
munniax
Printable View
Hi,
I'm a beginner in VB and i need to complete one task to list out all the RGB values from the .BMP image file. I have no idea how to do this coz i'm not familiar in Vb before.
Hopefully someone can help me.
Regards
munniax
Merry Christmas. ;)
VB Code:
Private Sub Form_Activate() With Picture1 .AutoRedraw = True .ScaleMode = vbPixels .AutoSize = True .BorderStyle = 0 End With Picture1.Picture = LoadPicture("C:\Temp\Sprite1.bmp") Dim X As Long, Y As Long Dim RGB_Array() As Long ReDim RGB_Array(Picture1.ScaleWidth - 1, Picture1.ScaleHeight - 1) As Long For Y = 0 To Picture1.ScaleHeight - 1 For X = 0 To Picture1.ScaleWidth - 1 RGB_Array(X, Y) = Picture1.Point(X, Y) Next X Next Y End Sub
You could also use the GetDIBits() API function which I believe is a bit faster. There's some info on it at: www.allapi.net
thanks
i will try first..