AutoHotkey Community

It is currently May 26th, 2012, 8:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: April 20th, 2005, 10:50 am 
Offline

Joined: April 18th, 2005, 11:03 am
Posts: 14
Location: WI, USA
Ok... lets say for the heck of it a guy (or girl eh) wants to open a picture and read all the pixel colors from the upper left corner to the right. When you hit the end of the image go down to the next line. Much like reading a book BUT!... also be able to record it to a text file.

The mentioned text file would look something like...

Code:
0x0000FF 0x00FF00 0xFF0000
0xFF0000 0x00FF00 0x0000FF


That would be a 3x2 pixel image

I have big plans for this but not sure what they are yet.. I'm thinking web applications of some sort LOL... so any help would be great.

_________________
"It was when I found out I could make mistakes that I knew I was on to something."
--Ornette Coleman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2005, 4:24 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
I made this colour capture script, it gets all the colours within the set regions and logs them to a file:
Code:
#SingleInstance ignore
SetBatchLines -1
; (--( Config )--)
xsStart = 0   ; X-Coordinate of search start
xsEnd = %A_ScreenWidth%   ; X-Coordinate of search end
ysStart = 0   ; Y-Coordinate of search start
ysEnd = %A_ScreenHeight%   ; Y-Coordinate of search end
LogFile = ColourID_Log.txt   ; File path of logfile

Loop, %ysEnd%
{
   Loop, %xsEnd%
   {
      PixelGetColor, ColourID, %xsStart%, %ysStart%
      FileAppend, %ColourID%`n, %LogFile%
      xsStart++
   }
   ysStart++
   xsStart = 0
   FileAppend, `n, %LogFile%
}
MsgBox, 64,, Finished searching the defined regions.`n`nResults logged to:`n%LogFile%
Run, %LogFile%

I tested the above for 10 seconds, the log came upto 156kb in that time alone O_O ... so change accordingly.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Last edited by polyethene on April 21st, 2005, 11:02 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2005, 4:26 pm 
1) pixelgetcolor from xcoord to xmaxcoord and append/write result to file
2) if xcoord = xmaxcoord, increase ycoord with 1, back to 1
3) if ycoord > ymaxcoord, done


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2005, 11:53 pm 
Offline

Joined: April 18th, 2005, 11:03 am
Posts: 14
Location: WI, USA
Titan wrote:
I made this colour capture script, it gets all the colours within the set regions and logs them to a file


Its nice... but being that its something another person made I'm not sure as to how I could modify it so a person could browse/open a pic and it would automatically get the pixel ratio and read it left/right and top/bottom. I tried but then um... well... I had to log back online and reget the code because it became completely F.U.B.A.R'd :oops:

I'm kinda newish to the more advanced things such as getting a script to work... or evolving past MouseMove or Send :roll:

...forgive me for my ignorance

_________________
"It was when I found out I could make mistakes that I knew I was on to something."
--Ornette Coleman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2005, 12:05 am 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
TheLostBoy, Did you know that getting a script to read from left to right and down is easier than you might think,

here is an example that reads the tiles of minesweeper in that same fashion.
Code:
;Determine where first box is
StartCoordX1 = 15
StartCoordY1 = 104

;Build Array Used to slove, This array is used to search screen and click
My_Index = 0
Loop, %XTiles%
{
   ;My_Index += 1
   StartCoordY1 = 104
   Loop, %YTiles%
   {
      My_Index += 1
      TileArray%My_Index% = [%StartCoordX1%]_[%StartCoordY1%]
      StartCoordY1 += 16
   }
   StartCoordX1 += 16
}


In this, Each tile is 16x16. We start at the left and work to the right by the X values then down by the Y Values. Have a look at this and feel free to ask me questions here or via Pm. Cus I think I know you.

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 21st, 2005, 9:23 am 
Offline

Joined: April 18th, 2005, 11:03 am
Posts: 14
Location: WI, USA
Invalid User wrote:
Have a look at this and feel free to ask me questions here or via Pm. Cus I think I know you.


You know me better then most people dude.. just remember... its in that place where i put that thing that time.

_________________
"It was when I found out I could make mistakes that I knew I was on to something."
--Ornette Coleman


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 56 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group