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. Visual Basic
  4. can anybody give me code of getting RGB value form an image

can anybody give me code of getting RGB value form an image

Scheduled Pinned Locked Moved Visual Basic
2 Posts 2 Posters 0 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.
  • U Offline
    U Offline
    User 416553
    wrote on last edited by
    #1

    hiiii i want that somebody give me code to get the RGB values from an image and show in edit boxes. its a bit urgent plz regards tahir

    D 1 Reply Last reply
    0
    • U User 416553

      hiiii i want that somebody give me code to get the RGB values from an image and show in edit boxes. its a bit urgent plz regards tahir

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      What you can do is use the Bitmap class GetPixel method to get the Color of that pixel, then use the Color class R, G, and B properties to get the values you want.

      Dim MyImage As New Bitmap("C:\testimage.jpg")
      Dim pixelColor As Color = MyImage.GetPixel(0,0)
      Dim r As Byte = pixelColor.R
      Dim b As Byte = pixelColor.B
      Dim g As Byte = pixelColor.G

      RageInTheMachine9532

      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