Sign in to follow this  
Followers 0
Mster

help with bmp getpixel

3 posts in this topic

What i am trying to do is make a sort of wii-mote for my pc. I have already modified my webcam to receive IR light from a remote control, and used the webcam script in the example forums to take a snaphot of that into a bmp every 300 miliseconds. What i need is a way to find out the color of a pixel inside that bmp, so that i can search for the first white one (sign of IR light) and move the mouse accordingly. So far i have tried gdi32.dll, system.drawing.bitmap object to no avail. Please help me i am tired of looking. The getpixel funtion has to be reasonably fast too, and not rely on preloading the image,for obvious reasons.

Share this post


Link to post
Share on other sites



What i am trying to do is make a sort of wii-mote for my pc. I have already modified my webcam to receive IR light from a remote control, and used the webcam script in the example forums to take a snaphot of that into a bmp every 300 miliseconds. What i need is a way to find out the color of a pixel inside that bmp, so that i can search for the first white one (sign of IR light) and move the mouse accordingly. So far i have tried gdi32.dll, system.drawing.bitmap object to no avail. Please help me i am tired of looking. The getpixel funtion has to be reasonably fast too, and not rely on preloading the image,for obvious reasons.

Not sure what you mean by not preloading the image if you are going to move the mouse to a part o fthe picture.

Doesn't PixelSearch do what you want?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

I'm sorry, i think i made it pretty confusing. So, the webcam script saves a bmp every 300 miliseconds in C:\shot.bmp.. What i want it to do after taking the shot is to analyse the picture and move the mouse realtive to where the first white pixel in the bitmap is. That way you would have a sort of wii-ish remote by pointing with a remote control at the webcam and moving it. I can't use pixelsearch because the picture will not apperar on the screen for example when playing a game. I hope this makes it clearer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0