Results 1 to 2 of 2

Thread: What API shows a PictureBox in greyscale?

  1. #1

    Thread Starter
    Addicted Member Michel Jr's Avatar
    Join Date
    Jan 2000
    Location
    Brazil
    Posts
    175

    Post

    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]

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width