Results 1 to 7 of 7

Thread: [RESOLVED] How to loop inside a Picture which is captured from my webcam?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2011
    Posts
    24

    Resolved [RESOLVED] How to loop inside a Picture which is captured from my webcam?

    Hi

    I am currently having problems on how to loop inside a picture which is being captured by a webcam.

    it is already "bitmap" in form when i copied to from the clipboard to the picturebox?

    i already figured out how to capture images from my webcam, but my problem now is to get the color inside the image being captured (the image is inside a picturebox)
    i tried hard figuring this out. i have found alot of codes like: color under mouse, and color picker. but are they related to what i am making now?
    sorry for my bad english.
    I hope you guys can help me with this.


    Here is my code:
    List1.Clear
    px = Picture4.Width / Screen.TwipsPerPixelX / 2
    py = Picture4.Height / Screen.TwipsPerPixelY / 2

    For i = 1 To Picture4.Width / Screen.TwipsPerPixelX Step 3
    For j = 1 To Picture4.Height / Screen.TwipsPerPixelY Step 3
    'Convert to RGB
    'Picture4.Circle (px * Screen.TwipsPerPixelX, py * Screen.TwipsPerPixelY), 10, RGB(255, 0, 0)
    r = (GetPixel(Picture4.hdc, i, j) Mod 256)
    b = Int(GetPixel(Picture4.hdc, i, j) / 65536)
    g = (GetPixel(Picture4.hdc, i, j) - (b * 65536) - r) / 256

    List1.AddItem "RGB=" & r & " " & g & " " & b



    Next

    Next


    End Sub

    is this the right way to get the image's color in rgb???
    Last edited by skemb321; Jan 6th, 2011 at 03:10 PM.

    interest controls curiosity.
    conscience controls karma.
    you alone can control yourself.
    know yourself and be above those who are lost.
    skemb321
    hehehe

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width