get pixel color on image
-
Hello,i want a code which retrieve the color from an image.where image is in fix format and x-y co-ordinate also...i want a read pixel and find the color of that pixel not by mouse positioning by only co-ordinates.plzzzzzzzzz :confused:
-
Hello,i want a code which retrieve the color from an image.where image is in fix format and x-y co-ordinate also...i want a read pixel and find the color of that pixel not by mouse positioning by only co-ordinates.plzzzzzzzzz :confused:
What have you tried so far ? How many bits per pixel in the images: 1,4,8,16,24,32 ? Show us some code.
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
-
Hello,i want a code which retrieve the color from an image.where image is in fix format and x-y co-ordinate also...i want a read pixel and find the color of that pixel not by mouse positioning by only co-ordinates.plzzzzzzzzz :confused:
-
Hello,i want a code which retrieve the color from an image.where image is in fix format and x-y co-ordinate also...i want a read pixel and find the color of that pixel not by mouse positioning by only co-ordinates.plzzzzzzzzz :confused:
There are two ways depending if you need performance or not. Use GetPixel (not performant) or LockBits and and seek the byte (s) (can be calculated using Scan0 position plus y * stride + ( x * bits per pixel) assuming non indexed - for indexed this will give a reference in the pallet object which will hold the colour. Many examples of basic GDI+ lockbits scanning on the web.