shadowbladex Posted September 28, 2008 Share Posted September 28, 2008 (edited) Hi, i am working on a little project that requires me to search for a pixel color in a specified field.So far i have managed to make it work on a preset location pixelsearch box, everything works flawlessly.But for maximum versatility i want to make it so i can click on a point on my screen, then it will form a preset sized pixelsearchbox around the point i clicked at.So like for example i would like to be able to press f10, then it asks me to click somewhere. Then it takes that location i clicked at and form a preset sized pixelsearch box around it.The gray dot would be a point i clicked at on my screen.The red square would be the preset sized pixelsearch box that gets made around it.I hope i explained it well enough for someone to understand.As always, any help on how to do this is greatly appreciated. Edited September 28, 2008 by shadowbladex Link to comment Share on other sites More sharing options...
Community On Patrol Posted September 28, 2008 Share Posted September 28, 2008 Hi shadowbladex, Doing a search of your topic, it's been found many times with the search feature or is listed as a non-descriptive topic. Please do a search before posting new thread topics. And please use descriptive topics so that others that do use the search feature may also find what they are seeking. (You'll also find that using descriptive topics, will get people in your thread that know how to answer your questions, those same people ignore non-descriptive topics). Thanks. Link to comment Share on other sites More sharing options...
shadowbladex Posted September 28, 2008 Author Share Posted September 28, 2008 (edited) Hi shadowbladex,Doing a search of your topic, it's been found many times with the search feature or is listed as a non-descriptive topic.Please do a search before posting new thread topics.And please use descriptive topics so that others that do use the search feature may also find what they are seeking.(You'll also find that using descriptive topics, will get people in your thread that know how to answer your questions, those same people ignore non-descriptive topics).Thanks.Yes Mr. Bot, i have already searched and was not able to find what i was looking for. Silly bot. >_< Edited September 28, 2008 by shadowbladex Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 29, 2008 Share Posted September 29, 2008 Yea, I did a search for you just to double check, I didn't find anything either. Although I do love this idea. =] Link to comment Share on other sites More sharing options...
shadowbladex Posted September 29, 2008 Author Share Posted September 29, 2008 No one can help? Link to comment Share on other sites More sharing options...
Xand3r Posted September 29, 2008 Share Posted September 29, 2008 Func test() While Not _IsPressed(01) Sleep(100) WEnd $pos=MouseGetPos() $ps=PixelSearch($pos[0]-$width/2,$pos[1]-$height/2,$pos[0]+$width/2,$pos[1]+$height/2,$yourcolor) EndFunc Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
shadowbladex Posted September 29, 2008 Author Share Posted September 29, 2008 (edited) Func test() While Not _IsPressed(01) Sleep(100) WEnd $pos=MouseGetPos() $ps=PixelSearch($pos[0]-$width/2,$pos[1]-$height/2,$pos[0]+$width/2,$pos[1]+$height/2,$yourcolor) EndFunc Oh thats awesome thanks! Could you explain a bit on how "$ps=PixelSearch($pos[0]-$width/2,$pos[1]-$height/2,$pos[0]+$width/2,$pos[1]+$height/2,$yourcolor)" works? How big will this make the pixelsearch box? What numbers correspond with the size of the box? Edited September 30, 2008 by shadowbladex Link to comment Share on other sites More sharing options...
Xand3r Posted September 30, 2008 Share Posted September 30, 2008 $width is the width of the box and $height is the height of the box so if $width=100 and $height=100 then the box will be 100x100 pixels (50 pixels up,50 down,50 left,50 right) if $width=40 and $height=80 the box will be 40x80 pixels (40 pixels up,40 down,20 left and 20 right) cheers Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
shadowbladex Posted September 30, 2008 Author Share Posted September 30, 2008 $width is the width of the box and $height is the height of the box so if $width=100 and$height=100 then the box will be 100x100 pixels (50 pixels up,50 down,50 left,50 right)if $width=40 and $height=80 the box will be 40x80 pixels (40 pixels up,40 down,20 left and 20 right)cheers >_<You are a legend. Thanks so much Link to comment Share on other sites More sharing options...
haura Posted November 30, 2008 Share Posted November 30, 2008 Keep in mind that Pixel Search always searches the specified rectangle in a 1. left-to-right then 2. top-to-bottom pattern until it finds a pixel matching the specified <colour> to within <shade-variation> tolerance. That left to right, top to bottom hard coded limitation may not always yield the result you are looking for. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now