Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. get pixel color on image

get pixel color on image

Scheduled Pinned Locked Moved C#
help
4 Posts 4 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 10225529
    wrote on last edited by
    #1

    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:

    B L A 3 Replies Last reply
    0
    • M Member 10225529

      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:

      B Offline
      B Offline
      BillWoodruff
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • M Member 10225529

        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:

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        See http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.getpixel.aspx[^].

        Veni, vidi, abiit domum

        1 Reply Last reply
        0
        • M Member 10225529

          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:

          A Offline
          A Offline
          AngloThaiSolutions
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups