AutoHotkey Community

It is currently May 27th, 2012, 3:50 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 181 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 13  Next
Author Message
 Post subject:
PostPosted: October 12th, 2009, 1:41 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
My preference is using 4 separate thin bars/GUIs than using a big transparent GUI.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 1:06 am 
Offline

Joined: September 20th, 2006, 2:05 pm
Posts: 73
I added these

Code:
   Else If   aRect = 4
   {
      MouseGetPos, x1, y1
      Sleep, 5000
      MouseGetPos, x2, y2
      nL := x1
      nT := y1
      nW := x2 - x1
      nH := y2 - y1
   }
   Else If   aRect = 5
   {
      MySelectRect(x1, y1, x2, y2)
      nL := x1
      nT := y1
      nW := x2 - x1
      nH := y2 - y1
   }
   Else If  aRect = 6
   {
      MySelectRect2(x1, y1, x2, y2)
      nL := x1
      nT := y1
      nW := x2 - x1
      nH := y2 - y1
   }


Code:
MySelectRect(ByRef x1, ByRef y1, ByRef x2, ByRef y2)
{
   KeyWait, LButton, D
   MouseGetPos, x1, y1
   Sleep, 1000
   Gui, +AlwaysOnTop -caption +Border +ToolWindow +LastFound
   WinSet, Transparent, 150
   Gui, Color, yellow

   While, !(GetKeyState("LButton", "p"))
   {
       MouseGetPos, x2, y2
       w := abs(x1 - x2)
       h := abs(y1 - y2)
       If ( x1 < x2 )
       X := x1
       Else
       X := x2
       If ( y1 < y2 )
       Y := y1
       Else
       Y := y2
       Gui, Show, x%X% y%Y% w%w% h%h%
       Sleep, 10
   }

   MouseGetPos, x2, y2
   Gui, Destroy
   If ( x1 > x2 )
   {
       temp := x1
       x1 := x2
       x2 := temp
   }
   If ( y1 > y2 )
   {
       temp := y1
       y1 := y2
       y2 := temp
   }
   Area = %x1%, %y1%, %x2%, %y2%
   Sleep, 100
   return
}

MySelectRect2(ByRef x1, ByRef y1, ByRef x2, ByRef y2)
{
   KeyWait, LButton, D
   MouseGetPos, x1, y1
   Gui, +AlwaysOnTop -caption +Border +ToolWindow +LastFound
   WinSet, Transparent, 80
   Gui, Color, lime

   While, (GetKeyState("LButton", "p"))
   {
       MouseGetPos, x2, y2
       w := abs(x1 - x2)
       h := abs(y1 - y2)
       If ( x1 < x2 )
       X := x1
       Else
       X := x2
       If ( y1 < y2 )
       Y := y1
       Else
       Y := y2
       Gui, Show, x%X% y%Y% w%w% h%h%
       Sleep, 10
   }

   MouseGetPos, x2, y2
   Gui, Destroy
   If ( x1 > x2 )
   {
       temp := x1
       x1 := x2
       x2 := temp
   }
   If ( y1 > y2 )
   {
       temp := y1
       y1 := y2
       y2 := temp
   }
   Area = %x1%, %y1%, %x2%, %y2%
   Sleep, 100
   return
}



MySelectRect: Click once and hover to make a selection

MySelectRect2: Press and hold Left mouse button to make a selection


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2010, 4:43 am 
hi,
i haven't read all the post ... is possible to save an area x,y,x,y of the active window?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2010, 11:25 pm 
Offline

Joined: April 14th, 2009, 10:40 am
Posts: 182
@Trigun:
Yes, you can!
Get the upper/left corner position of your wanted window (WinGetPos)
And play with upper/left corner of the wanted area from the last point found.
Be carefull with CoordMode!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2010, 11:57 pm 
Offline

Joined: March 31st, 2010, 3:35 pm
Posts: 1
What would I have to do to be able to specify the color depth of an output bitmap? Full color bitmaps are usually pretty big, but a 16 color bitmap is sufficiently clear and small for stuffing in an email.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2010, 4:54 pm 
Offline

Joined: April 18th, 2010, 11:33 am
Posts: 159
try this i made using sc

http://www.autohotkey.com/forum/viewtopic.php?t=57127


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 3rd, 2010, 12:06 pm 
Offline

Joined: February 7th, 2008, 9:48 pm
Posts: 509
Using the screencapture function on small selections i found that the captured rectangle was smaller by 1pixel than the selected using its coordinates by mousegetpos.

Quote:
aRect can be comma delimited sequence of coordinates, e.g., "Left, Top, Right, Bottom"


Code:
Else
   {
      StringSplit, rt, aRect, `,, %A_Space%%A_Tab%
      nL := rt1
      nT := rt2
      nW := rt3 - rt1
      nH := rt4 - rt2
      znW := rt5
      znH := rt6
   }




I had to change this by adding 1 pixel

nW := rt3 - rt1 + 1
nH := rt4 - rt2 + 1


if you look at an image 10x10 you get pixel coordinates 0,0 and 9,9

so it returns an image 9x9

or am I mistaken ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 3rd, 2010, 1:41 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Rect(angle) is left/top inclusive and right/bottom exclusive. So, if you want 10x10 rectangle, you have to specify (0,0) - (10,10), as in, for example, (0,0) - (A_ScreenWidth, A_ScreenHeight) for the whole screen (:check the coordinates of the left/top/right/bottom edges of your screen).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 3rd, 2010, 4:40 pm 
Offline

Joined: February 7th, 2008, 9:48 pm
Posts: 509
Thanks Sean

That explains the result but then i leave the +1 so the selection is from screencoordinates given by the mouseposition so i can use these values directly.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 4th, 2010, 1:30 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
yume wrote:
That explains the result but then i leave the +1 so the selection is from screencoordinates given by the mouseposition so i can use these values directly.
It's the rule of Windows itself, so IMO you'd better tweak the code retrieving right/bottom than the formulas of width/height.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 16th, 2010, 12:31 am 
..:: Free Radical ::.. wrote:
I added these

...

MySelectRect: Click once and hover to make a selection

MySelectRect2: Press and hold Left mouse button to make a selection


If you want the Gui to Exit in the end, use ExitApp instead of Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2010, 10:04 am 
Offline

Joined: August 18th, 2009, 12:07 pm
Posts: 375
Location: holland
so this script captures the screen and puts the output in clipboard.
but I can just press PrtSc on my keyboard for that
is this script using the same inbuilt windows funcitons as the prtsc key does?

_________________
"Choose your parents wisely"


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 5th, 2010, 5:20 pm 
Offline

Joined: August 5th, 2010, 4:59 pm
Posts: 1
Screencapture vs. PrtSc key

mouse wrote:
I can just press PrtSc on my keyboard for that

Mouse, the PtrSc key will capture the screen in the clipboard without the mouse pointeur.
You could be concerned with such a nickname ;-)

With sc_CaptureScreen, you can specify if you want the mouse pointer or not in your .ahk script:
Code:
; Ctrl + PrintScreen captures the full screen aRect = 0, bCursor = true, sFileTo = 0 in clipboard
^PrintScreen::
sc_CaptureScreen(0, True, 0)
return

; Ctrl Alt + PrintScreen captures the active window aRect = 1, bCursor, sFileTo = 0 in clipboard
^!PrintScreen::
sc_CaptureScreen(1, True, 0)
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2010, 5:02 pm 
Offline

Joined: August 25th, 2010, 1:27 am
Posts: 18
Didn't work for cursor in http://www.siegeonline.ru/ru/start.asp SiegeOnline game (sorry, it's Russian)

...

IrfanView's screenshot with mouse, however, worked. Any tips on getting on the right way?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 6th, 2010, 8:56 pm 
I am using
CaptureScreen(0,false,"FCHotkeyImgs\blat\screencapture%A_ComputerName%.png")

But since the path is in quotes is there any way to get a varible in the path so I do not end up with several computers accessing the file at the same time. I have this capturing errors and wanted to add a screen capture of the current state in with the email it sends.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 181 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 13  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 22 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