What is the simplest script to capture a block or range of pixel colors and then display the results in a usable way?
For example, the following script gets the colors for the 16 pixels in the 4 x 4 block at (with its upper-left corner at) 115, 2035:
Code: Select all
F5::
CoordMode, Mouse, Screen
xA:=115
xB:=116
xC:=117
xD:=118
yA:=2035
yB:=2036
yC:=2037
yD:=2038
CoordMode, Pixel, Screen
PixelGetColor, cAA, xA, yA
PixelGetColor, cAB, xA, yB
PixelGetColor, cAC, xA, yC
PixelGetColor, cAD, xA, yD
PixelGetColor, cBA, xB, yA
PixelGetColor, cBB, xB, yB
PixelGetColor, cBC, xB, yC
PixelGetColor, cBD, xB, yD
PixelGetColor, cCA, xC, yA
PixelGetColor, cCB, xC, yB
PixelGetColor, cCC, xC, yC
PixelGetColor, cCD, xC, yD
PixelGetColor, cDA, xD, yA
PixelGetColor, cDB, xD, yB
PixelGetColor, cDC, xD, yC
PixelGetColor, cDD, xD, yD
Msgbox Colors for 4 x 4 range at %xA%, %yA%
(Join
`n
`n%cAA%
`n%cAB%
`n%cAC%
`n%cAD%
`n
`n%cBA%
`n%cBB%
`n%cBC%
`n%cBD%
`n
`n%cCA%
`n%cCB%
`n%cCC%
`n%cCD%
`n
`n%cDA%
`n%cDB%
`n%cDC%
`n%cDD%
)
Return
Questions:Colors for 4x4 range at 115, 2035
0x0E2112
0x0CIEI0
0x0AlC0F
0x0D2212
0x102212
0x0E2111
0x0D2111
0x0E2414
0x102213
0x0E2213
0x0E2213
0x0E2514
0x122213
0x102212
0x0E2112
0x0D2615
1) Is there a simpler (shorter) way to write the script?
2) In place of the single column shown above, how can you get the MsgBox to arrange the results in four columns (to correspond to the actual pixel location)? In other words, is there a character for starting a new column (similar to how `n starts a new line) so that it looks as follows (ignore the vertical bars which are supposed to be aligned):
3) Is there a way to modify the MsgBox so that its contents can be selected, copied, and pasted (into Excel for example)?Colors for 4x4 range at 115, 2035
| 0x0E2112 | 0x102212 | 0x102213 | 0x122213 |
| 0x0CIEI0 | 0x0E2111 | 0x0E2213 | 0x102212 |
| 0x0AlC0F | 0x0D2111 | 0x0E2213 | 0x0E2112 |
| 0x0D2212 | 0x0E2414 | 0x0E2514 | 0x0D2615 |
Thanks