Results 1 to 7 of 7

Thread: Help!

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    2

    Re: Help!

    Quote Originally Posted by singularis
    Is this a robotics question?
    Um, yes. It is. I didn't know there was a section on that. But what I'm trying to do is identify a white dot and put the mouse there.

  2. #2
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: Help!

    Ok, if you are attempting to make a simulation of this I can help you.

    Get the picture of "what the robot sees" in a picture box and make a function that loops round all the pixels in the box to find any white ones.

    I take it that you know how to use loops, there is an API call known as GetPixel which returns the colour of the pixel at specified coordinates.

    It looks somewhat like this:
    Code:
    Private Declare Function GetPixel Lib "GDI32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long) As Long
    Obviously as soon as your program finds a white pixel then it will know where the white target is.
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

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