Hello,
I'm developing an Activex control and need to do a PictureBox show a picture in
greyscale.
Is there a Windows API to do that?
Thanks for any help
[email protected]
Printable View
Hello,
I'm developing an Activex control and need to do a PictureBox show a picture in
greyscale.
Is there a Windows API to do that?
Thanks for any help
[email protected]
This may not totally help you, but here is a function that can greyscale a color.
Function GreyScale(ByVal Colr As Long) As Integer
' Takes a long integer color value and converts it' to an equivalent grayscale value between 0 and 255
Dim R As Long, G As Long, B As Long
' Break up long color value into red, green, blue
R = Colr Mod 256
Colr = Colr \ 256
G = Colr Mod 256
Colr = Colr \ 256
B = Colr Mod 256
' Find equivalent grayscale value, 0 - 255.
GreyScale = 76 * R / 255 + 150 * G / 255 + 28 * B / 255
End Function
NB: Could you send me a copy of the ActiveX when you are finished with it.
------------------
OmarSwan
[email protected]
http://www.omarswan.cjb.net
To God Be The Glory