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. image's read pixel with VB6

image's read pixel with VB6

Scheduled Pinned Locked Moved Visual Basic
comquestion
4 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.
  • 2 Offline
    2 Offline
    2ndhandcomputer
    wrote on last edited by
    #1

    Hi, Now I read images properties with "type declaration". But I don't still image's read pixels. How I read image's line? (10W, 50H) 1,2,3,4,5,6,7,8,9,10W, 1st H 1,2,3,4,5,6,7,8,9,10W, 2st H 1,2,3,4,5,6,7,8,9,10W, 3st H ... 1,2,3,4,5,6,7,8,9,10W, 50th H http://www.2ncielbilgisayar.com

    J 1 Reply Last reply
    0
    • 2 2ndhandcomputer

      Hi, Now I read images properties with "type declaration". But I don't still image's read pixels. How I read image's line? (10W, 50H) 1,2,3,4,5,6,7,8,9,10W, 1st H 1,2,3,4,5,6,7,8,9,10W, 2st H 1,2,3,4,5,6,7,8,9,10W, 3st H ... 1,2,3,4,5,6,7,8,9,10W, 50th H http://www.2ncielbilgisayar.com

      J Offline
      J Offline
      Jose Cezar S Ynion
      wrote on last edited by
      #2

      HI, I can't fully understand your question but if your trying to read the image pixel in VB then here's an alternative. 1. Put a PictureBox in your form. 2. Load your desired image by setting its Picture property. 3. Then use this code dim x as long dim y as long dim rgbColor as long For y = 0 To picBox.ScaleHeight - 1 For x = 0 To picBox.ScaleWidth - 1 rgbColor = GetPixel(picBox.hDC, x, y) Next x Next y

      2 1 Reply Last reply
      0
      • J Jose Cezar S Ynion

        HI, I can't fully understand your question but if your trying to read the image pixel in VB then here's an alternative. 1. Put a PictureBox in your form. 2. Load your desired image by setting its Picture property. 3. Then use this code dim x as long dim y as long dim rgbColor as long For y = 0 To picBox.ScaleHeight - 1 For x = 0 To picBox.ScaleWidth - 1 rgbColor = GetPixel(picBox.hDC, x, y) Next x Next y

        2 Offline
        2 Offline
        2ndhandcomputer
        wrote on last edited by
        #3

        You understood me. Thank you. rgbColor = GetPixel(picBox.hDC, x, y) I saw a few .hDC in example codes. And you wrote .hDC in your code. what does .hDC? Has vb6 got GetPixel command? http://www.2ncielbilgisayar.com

        J 1 Reply Last reply
        0
        • 2 2ndhandcomputer

          You understood me. Thank you. rgbColor = GetPixel(picBox.hDC, x, y) I saw a few .hDC in example codes. And you wrote .hDC in your code. what does .hDC? Has vb6 got GetPixel command? http://www.2ncielbilgisayar.com

          J Offline
          J Offline
          Jose Cezar S Ynion
          wrote on last edited by
          #4

          GetPixel is an API. You can declare this at the top of your code Private Declare Function GetPixel Lib "gdi32" _ (ByVal hDC As Long, _ ByVal x As Long, _ ByVal y As Long) As Long hDC is a device context handle, needed when working a display or printer. This can be compared to HWND when your are working with window object, one use of HDC on the other hand is for drawing.

          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