Thread: Pixel Vaules

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    37

    Pixel Vaules

    In Borland C++ Builder how do you access pixel values of an image object. I want to be able to convert a picture to grayscale and also count the color values of an image.

    I am also trying to copy a small part of an image to a seperate image object.


    Thanks

  2. #2
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    You could use TBitmap->Canvas to set pixels. However, if it's speed you're after, use TBitmap->ScanLine, which returns a row (array) of pixels, as a void*. You need to cast the return of ScanLine, and the cast depends on the colour depth of your image.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    37
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing pixel colour
    By redruby147 in forum C Programming
    Replies: 11
    Last Post: 06-09-2009, 05:28 AM
  2. How can I make this code more elegant?
    By ejohns85 in forum C++ Programming
    Replies: 3
    Last Post: 04-02-2009, 08:55 AM
  3. Reading pixel color data from screen
    By JJFMJR in forum Windows Programming
    Replies: 8
    Last Post: 08-22-2008, 12:27 PM
  4. Getting Pixel Colour Screen
    By god_of_war in forum C++ Programming
    Replies: 3
    Last Post: 03-14-2006, 01:17 PM
  5. Pixel Shaders.
    By Cheeze-It in forum Game Programming
    Replies: 1
    Last Post: 05-21-2002, 01:16 AM