| View previous topic :: View next topic |
| Author |
Message |
TheLostBoy
Joined: 18 Apr 2005 Posts: 14 Location: WI, USA
|
Posted: Wed Apr 20, 2005 9:50 am Post subject: I have no idea what I'm trying 2 say..something about pixels |
|
|
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 |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Wed Apr 20, 2005 3:24 pm Post subject: |
|
|
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. _________________

Last edited by Titan on Thu Apr 21, 2005 10:02 am; edited 1 time in total |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Apr 20, 2005 3:26 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
TheLostBoy
Joined: 18 Apr 2005 Posts: 14 Location: WI, USA
|
Posted: Wed Apr 20, 2005 10:53 pm Post subject: |
|
|
| 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
I'm kinda newish to the more advanced things such as getting a script to work... or evolving past MouseMove or Send
...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 |
|
| Back to top |
|
 |
Invalid User
Joined: 14 Feb 2005 Posts: 442 Location: Texas, Usa
|
Posted: Wed Apr 20, 2005 11:05 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
TheLostBoy
Joined: 18 Apr 2005 Posts: 14 Location: WI, USA
|
Posted: Thu Apr 21, 2005 8:23 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
|