Results 1 to 4 of 4

Thread: GetPixel Color Value

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2006
    Posts
    23

    GetPixel Color Value

    Im using the BitMap object to get a pixel color.
    Code:
    BitMap.GetPixel
    No Im not sure as to how to convert that to a string or to view that in any. The only thing I want to do is get the colour value of the Bitmap pixel. As in black would be 255 and white would be 0. Anyone know how to do this?
    Last edited by Root Core; Mar 13th, 2006 at 08:50 PM.

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: GetPixel Color Value

    GetPixel returns a color object doesn't it? With that color you should have the following methods available to you :

    GetRed()
    GetGreen()
    GetBlue()

  3. #3
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: GetPixel Color Value

    From MSDN:

    A Color object stores a 32-bit value that represents a color. The color value contains four, 8-bit components: alpha, red, green, and blue. The first 8 bits (the most significant) contain the alpha component, the next 8 bits contain the red component, the next 8 bits contain the green component, and the next 8 bits (the least significant) contain the blue component. The 32-bit value is stored in a variable of type ARGB.

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: GetPixel Color Value

    you could just access the R, G, B, A fields of your Color object
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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