Results 1 to 2 of 2

Thread: converting a long to a RGB

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Question

    i am useing this

    Public Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

    i am guessing it returns the color, but it is a long, how can i convert it to rbg?

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    This should do it:

    Code:
    Red = LngColour Mod 256 
    Green = Int(LngColour / 256) Mod 256 
    Blue = Int(LngColour / &h10000)
    Harry.

    "From one thing, know ten thousand things."

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