AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

I have no idea what I'm trying 2 say..something about pixels

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
TheLostBoy



Joined: 18 Apr 2005
Posts: 14
Location: WI, USA

PostPosted: Wed Apr 20, 2005 9:50 am    Post subject: I have no idea what I'm trying 2 say..something about pixels Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Apr 20, 2005 3:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
BoBo
Guest





PostPosted: Wed Apr 20, 2005 3:26 pm    Post subject: Reply with quote

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

PostPosted: Wed Apr 20, 2005 10:53 pm    Post subject: Reply with quote

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 Embarassed

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

...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
View user's profile Send private message Visit poster's website AIM Address
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Apr 20, 2005 11:05 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
TheLostBoy



Joined: 18 Apr 2005
Posts: 14
Location: WI, USA

PostPosted: Thu Apr 21, 2005 8:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group