AutoHotkey Community

It is currently May 26th, 2012, 1:00 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 181 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 13  Next
Author Message
 Post subject:
PostPosted: September 4th, 2008, 6:20 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
BoBo² wrote:
Is it possible with that script to have a snapshoot and rescale/downsize it to a variable/preset ratio of eg 33/100% before saving? That to create thumbnail images from screenshoots 'on-the-fly'.

Feedback much appreciated.
8)


I would use the gdi+ library for this


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2008, 6:25 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
BoBo² wrote:
Is it possible with that script to have a snapshoot and rescale/downsize it to a variable/preset ratio of eg 33/100% before saving? That to create thumbnail images from screenshoots 'on-the-fly'.

Feedback much appreciated.
8)


I am assuming you want something simple and easy enough to implement - so you should download the ScreenCapture.ahk at the top of this thread and read the comments inside.
It has a simple function that gets coordinates and a zoom factor, and it captures and saves PNGs or BMPs or JPGs (I think).
Really easy and useful - I use it to do timed scaled down captures of the screen.

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2008, 10:18 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
BoBo² wrote:
Is it possible with that script to have a snapshoot and rescale/downsize it to a variable/preset ratio of eg 33/100% before saving? That to create thumbnail images from screenshoots 'on-the-fly'.
There are a variety of ways to do it. GDI+ even has a thumbnail specific function, GdipGetImageThumbnail. Anyway, ScreenCapture.ahk already has this functionality:
Icarus wrote:
It has a simple function that gets coordinates and a zoom factor, and it captures and saves PNGs or BMPs or JPGs (I think). Really easy and useful - I use it to do timed scaled down captures of the screen.

For example,
Code:
CaptureScreen("100, 100, 500, 500, 128, 128")
This will capture the region (100,100) ~ (500,500) and save to 128x128 image.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 4th, 2008, 11:27 pm 
Thx tic/icarus/Sean. 8)
I've oviously missed that specific information within the scripts documentation. :oops:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 5th, 2008, 3:31 pm 
Offline

Joined: May 21st, 2007, 3:44 pm
Posts: 176
Location: USA
Do a search, someone just asked/answered this (I think that the answer was yes and had to do with GDI)

_________________
-------------
Scott Mattes
Image
My small, and slowly growing, collection of scripts.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Help w/this script
PostPosted: September 18th, 2008, 4:00 pm 
I'm currently trying to use this function as a call from another program but it isn't working correctly. I keep getting a screen.bmp file when I desire a JPG. Here's how I'm currently implementing it...

AutoHotkey.ahk has some commands in a loop that call
CaptureScreen(1, False, A_ScriptDir . "\screen.jpg", nQuality:=85)

and I'm using the default settings for CaptureScreen.ahk

1) there are comments commands before
; CaptureScreen() and ;Return
2) the next line is
CaptureScreen(aRect = 0, bCursor = False, sFile= "", nQuality = "") which are the defaults.

Yes, I'm new to scripting but not to programming (but it has been a while).
I've gotten most of my code to work correctly except this part. I know that gdiPlus is working as I tried out Holomind's code and it captured PNGs just fine.

Any ideas??? Sorry if it is obvious. Can I ask someone to give a detailed response?


Report this post
Top
  
Reply with quote  
 Post subject: Help w/this script
PostPosted: September 18th, 2008, 4:00 pm 
I'm currently trying to use this function as a call from another program but it isn't working correctly. I keep getting a screen.bmp file when I desire a JPG. Here's how I'm currently implementing it...

AutoHotkey.ahk has some commands in a loop that call
CaptureScreen(1, False, A_ScriptDir . "\screen.jpg", nQuality:=85)

and I'm using the default settings for CaptureScreen.ahk

1) there are comments commands before
; CaptureScreen() and ;Return
2) the next line is
CaptureScreen(aRect = 0, bCursor = False, sFile= "", nQuality = "") which are the defaults.

Yes, I'm new to scripting but not to programming (but it has been a while).
I've gotten most of my code to work correctly except this part. I know that gdiPlus is working as I tried out Holomind's code and it captured PNGs just fine.

Any ideas??? Sorry if it is obvious. Can I ask someone to give a detailed response?


Report this post
Top
  
Reply with quote  
PostPosted: September 18th, 2008, 4:45 pm 
Ok, well - the following is working at creating a screen.jpg file

CaptureScreen(1, False, "screen.JPG", 85)

but now I need to change the names automatically and I looked at the code in Holomind's script and put the following before the call to CaptureScreen

FormatTime, myTime, , yyyyMMdd_hhmmss
fileNameDestP = screens_%myTime%_%LoopCount%.JPG
CaptureScreen(1, False, %fileNameDestP%, 85)

so that it automatically changes the filename but I get an error with the variable %fileNameDestP% when it gets passed to CaptureScreen....

Error: The following variable name contains an illegal character : "screens_20080918_114420_1.JPG"


Any ideas and TIA...


Report this post
Top
  
Reply with quote  
 Post subject: Never mind
PostPosted: September 18th, 2008, 6:43 pm 
I thought I already tried passing it by reference and not by value but it's working now just by removing % signs and passing the variable...


CaptureScreen(1, False, %fileNameDestP%, 85)

CaptureScreen(1, False, fileNameDestP, 85)

works good now


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2008, 2:56 pm 
Offline

Joined: February 13th, 2008, 6:14 pm
Posts: 17
Location: Jakarta-Indonesia
Anonymous wrote:
BioBrain wrote:
I've been thinking, do U thing it's possible to search is image in clipboard is the same with image I want 2 search. kinda like ImageSearch but not on screen, but search in the Clipboard.

Sure it's possible. You can obtain, using GetClipboardData(), hbitmap (:DDB) or DIB. All necessary ones are ready by now. The remaining question is what procedure you're gonna use for the search, GetPixel through memory dc, where hbitmap is useful but maybe the slowest, or compare raw pixel, where DIB is handy, one by one, or may use hashes of the data.


GetClipboardData(), hbitmap (:DDB) or DIB ?

Any posted topic or tutorials about it? because I can't find it at AutoHotkey help.

Tx. :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2009, 8:43 am 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
Can someone help me adjust this to capture the entire desktop (multiple monitors) instead of just the primary monitor?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2009, 9:13 am 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
adamrgolf wrote:
Can someone help me adjust this to capture the entire desktop (multiple monitors) instead of just the primary monitor?


I've got this fixed, atleast for dual monitors by adjusting the if !aRect in CaptureScreen() function to this:

Code:
If   !aRect
   {
      SysGet, Mon, Monitor, 1
      nL := MonLeft
      nT := MonTop
      nW := MonRight - MonLeft
      nH := MonBottom - MonTop
   
      SysGet, Mon, Monitor, 2
      nL2 := MonLeft
      nT2 := MonTop
      nW2 := MonRight - MonLeft
      nH2 := MonBottom - MonTop
         
      nL := nL + nL2
      nT := nT + nT2
      nW := nW + nW2
      if nH2 >= nH
         nH := nH2
   }


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2009, 10:33 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
adamrgolf wrote:
Can someone help me adjust this to capture the entire desktop (multiple monitors) instead of just the primary monitor?

You can use
Code:
If   !aRect
{
   SysGet, nL, 76
   SysGet, nT, 77
   SysGet, nW, 78
   SysGet, nH, 79
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2009, 1:33 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
Sean wrote:
adamrgolf wrote:
Can someone help me adjust this to capture the entire desktop (multiple monitors) instead of just the primary monitor?

You can use
Code:
If   !aRect
{
   SysGet, nL, 76
   SysGet, nT, 77
   SysGet, nW, 78
   SysGet, nH, 79
}


I see, thanks :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2009, 1:51 pm 
Offline

Joined: December 28th, 2006, 9:46 am
Posts: 440
Irfanview offers an option to capture just the active screen. I wanted to do it with this, since it offers the option to not capture the mouse cursor.

What do you think about adding the following (or something similar) to your code, Sean?

Code:
Else If aRect = 3
   {
      MouseGetPos,mPx,mPy
      SysGet,mC,MonitorCount
      Loop % mC
         {
            SysGet, Mon, Monitor, %A_Index%
            nL := MonLeft
            nT := MonTop
            nW := MonRight - MonLeft
            nH := MonBottom - MonTop
            If ((mPx >= nL) AND (mPx <= nW)) AND ((mPy >= nT) AND (mPy <= nH))
               Break
         }
   }


Then option 3 would be to capture just the active screen, ie the monitor where your mouse is currently. Such as:

Code:
CaptureScreen(3,false,"c:\active_screen.bmp")


Last edited by adamrgolf on January 2nd, 2009, 3:01 pm, edited 1 time in total.

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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], DataLife and 12 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