AutoHotkey Community

It is currently May 27th, 2012, 9:44 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject:
PostPosted: October 10th, 2006, 10:58 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Note I added GDIplus_FreeImage to my wrapper, it might be what is needed...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2006, 10:53 pm 
Offline

Joined: October 27th, 2006, 6:35 am
Posts: 14
How do you use this to capture images spontaneously (frames for screen video)? I tried combining the copy with the save w/ one hotkey and looped it but it doesn't work. I can hold the hotkey but it's pretty slow so the quality isn't so good....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2006, 11:15 pm 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
@ahksimple: I think You will not be able to record the video as it is rendered as hardware overlay or Direct Draw, which is not visible in the Desktop HDc until you change Video acceleration to "Software" in Windows Media Player, "Performance" . Capturing Video to Hard drive is too slow with This ahk-script, you might use FRAPS for this
http://www.fraps.com/
i don't think this will work good enough with AHK or GDl in this case


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2006, 11:19 pm 
Offline
User avatar

Joined: December 20th, 2004, 12:19 pm
Posts: 798
Location: LooseChange911.com Ask Questions, Demand Answers █ The WTC bldgs █ shouldn't have fallen █ that fast
holomind wrote:
...you might use FRAPS for this...

...screw fraps...not free...& adds that annoying overlay on videos (never used it, but I've seen other peoples vids with that damn fraps overlay)...try...
  • Taksi (Sourceforge)
      site blurb: Taksi is a utility that allows you to take screenshots and record video clips of your favorite games and other 3D-graphics applications. Inspired by Fraps (www.fraps.com), Taksi aims to provide an open source alternative to that great tool.

      sf blurb: Taksi is a video capture/screen capture tool for 3D graphics applications (such as games). It can capture almost any windows application using DirectX, OpenGL, or GDI and create an AVI file using any installed VFW codec or still frames in PNG.
...I found this after all my other suggestions in the other post...I never said AHK would be fast enough to do it...just use CamStudio or Taksi...

_________________
AutoHotkey-Hotstring.ahk - Helping the world spell "AutoHotkey" correctly! (btw, it's a lowercase k!)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2006, 12:08 am 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
@jslover : You will never get 100 fps with GDI you will need DirectX/Draw or opengl to get enough Speed unless you want 2fps?!

Fraps perhaps does not really much ,it simply copies the Gfxfrontbuffer to a file.similar to this.If you cant afford $37
http://www.codeproject.com/audio/avigenerator.asp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2006, 6:24 am 
Offline

Joined: October 27th, 2006, 6:35 am
Posts: 14
Okay. I used to have FRAPS and it was free....I dunno but all the ones I've tried have some numbers in the corner or does some funky stuff with the mouse cursor. I use CursorXP to use different cursors but anyway, I'm sorry if this is getting off topic but quickly, does anyone know any video editing software with an interface that allows you to layer videos, music, captions, etc., add pics and manipulate them in other ways (separate the video file into segments, adjust time length of titles/captions/pics, basic effects/transitions, etc.)? Sort of like Windows Movie Maker interface with the duration and everything, only as a Movie editor instead... The main features I'm looking for are being able to seperate the video files and music into segments, cutting video/music short, and basically anything to edit/arrange (deleting parts out, taking sample clips from the files, changing the order, etc.) that I can save into a standard video file format (avi, mpg, wmv....).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2006, 12:44 pm 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
the ones i know are "adobe Premiere" and "final cut", or "aftereffects" but they are not cheap


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2006, 1:17 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
I saw good reviews (in French) of Pinnacle Studio Plus 10.0 (100€), Ulead VideoStudio 9 (80€), Magix Video Deluxe 2006 Plus (100€), Canopus Let’s Edit 2 (150€).
They are not cheap indeed... But I doubt a freeware would do this job.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2006, 3:22 am 
Offline

Joined: October 27th, 2006, 6:35 am
Posts: 14
Thanks. I'm going to try and make something that takes screenshots of specific actions when they happen, naming the screenshot files according to the action and takes the screenshot name info to show a log in a msgbox when I press a hotkey. Boy, that's going to take a lot of work (btw, I'm completely new to scripting if it wasn't obvious enough already). I've got a ton of studying to do. lol. Is there any other resources besides the quick start tut and the help guide? I can't find much on the format of scripts used for parameters and such(all those brackets and tabbing...and spaces).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 4:39 am 
Offline

Joined: November 12th, 2005, 10:25 pm
Posts: 73
@Holomind:
Great Utility :D but...
I upgraded your script to use the latest GDIplusWrapper.ahk from Philho, modded some things and inserted a HotKey to take PrintScreen of the ActiveWindow (Just like Alt+PrintScreen). Yes, it uses the Wrapper now instead of your Helper, sorry :(
The script got a lot easier to understand, thanks to Philho ;).
Script: ScreenShooter


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2006, 5:24 pm 
Offline

Joined: March 11th, 2006, 12:44 pm
Posts: 341
Location: Munich, Germany
@niho: for me the script looks very similar, but you added some for screenshot of region etc. the gdiwrapper is from philho and i only "use" it. there is much room to improve the script, its more a proof of concept, that you can make screenshots only with builtin tools like gdi or gdiplus. i am glad is somebody improves the script. in longterm using gdi (or graphics in general) with ahk will/should be improved. i also have some wrapper functions in the expose-clone script. because i dont like the dllcall-syntax and thus use wrappers.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: holomind
PostPosted: December 6th, 2006, 8:56 am 
Offline

Joined: December 6th, 2006, 8:34 am
Posts: 1
The code is function and the speed is ok.
Is it possible to add the curser pointer to the captured picture ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: SitaShot
PostPosted: February 17th, 2007, 4:19 am 
Offline

Joined: January 12th, 2007, 4:30 am
Posts: 531
Location: Norway
holomind and PhiLho,

Thanks! I've been wanting to make this little program for a year or so and this made it so much more tempting to start coding. I've been using QuickShot for some time which has the same functionality as this. I found QuickShot to be a little slow and I like the idea of hosting the screenshots on my own server. This takes a full screenshot of the screen and uploads it to your own FTP server. It's meant to be dead-simple and fast. I use it mostly in IM chats when the other person can't receive files. (I've only added the code-snippet between "#Z::" and "return", assides from that it's identical to holomind's script.)

Code:
#Include GDIPlusHelper.ahk
;SitaShot by Murp|e. Updated 2007-02-17.
;Takes a screenshot of your desktop and automatically uploads it to your web server.
;You need to customize this with the information from your server. Search this code for the string "your" and customize all the values. Take a screenshot with Win+Z.
;See: http://www.autohotkey.com/forum/viewtopic.php?t=11860 for orignal
;Credits to holomind and PhiLho for the excellent code!!


Menu, Tray, icon, SitaShot_Icon.ico

OnExit, handle_exit

main:
  FileCreateDir, screens
  FileCreateDir, thumbs

  WinGet, hw_frame, id, "Program Manager"   ; Desktop ?
  hdc_frame := DllCall( "GetDC", "uint",  hw_frame )
  hdc_frame_full := DllCall( "GetDC", "uint",  hw_frame )
  counter:=0   ; thumbnails
  counter_f:=0   ; fullscreens
  thumb_w:= 200
  thumb_h:= ceil( thumb_w * A_ScreenHeight / A_ScreenWidth ) ; keep screenratio
  use_antialize := 1
 

  ; buffer
  hdc_buffer := DllCall( "gdi32.dll\CreateCompatibleDC"     , "uint", hdc_frame )
  hbm_buffer := DllCall( "gdi32.dll\CreateCompatibleBitmap" , "uint", hdc_frame, "int", thumb_w, "int", thumb_h )
  r          := DllCall( "gdi32.dll\SelectObject"           , "uint", hdc_buffer, "uint", hbm_buffer )

  hdc_buffer_full := DllCall( "gdi32.dll\CreateCompatibleDC"     , "uint", hdc_frame_full )
  hbm_buffer_full := DllCall( "gdi32.dll\CreateCompatibleBitmap" , "uint", hdc_frame_full, "int", A_ScreenWidth, "int", A_ScreenHeight )
  r_full          := DllCall( "gdi32.dll\SelectObject"           , "uint", hdc_buffer_full, "uint", hbm_buffer_full )

  ; comment this line for speed but less quality
  if use_antialize = 1
    DllCall( "gdi32.dll\SetStretchBltMode", "uint", hdc_buffer, "int", 4 )  ; Halftone better quality with stretch

return

#Z::
Gosub, SaveImage_Full

FileDelete, Secret_FTP_Commands.txt
FileAppend,            ;Creates a temporary file with the FTP commands, could this be avoided?
(
yourdomain.com         ;The username you use to log on to your FTP.
yOurpassWOrd           ;The password you use to log on to your FTP.
cd /yoursub/folders     ;Choose a subfolder on your web domain such as /screenshots
lcd \screens
bin
prompt n
put "%fileNameDestP%"  ;Uploads the file.
quit
), Secret_FTP_Commands.txt

runwait, ftp -s:Secret_FTP_Commands.txt ftp.yourdomain.com
FileDelete, Secret_FTP_Commands.txt

clipboard = http://www.yourdomain/yoursub/folders/%SitaShotFilename% ; Change this line too. Same values as above.
msgbox, Screenshot successfully uploaded and link copied to clipboard! ;It doesn't know if anything actually succeeded, it's just very optimistic about it all.
return


#v::
SaveImage_Full:
  counter_f := counter_f +1
  FormatTime, myTime, , yyyyMMdd_hhmmss
  fileNameDestP = screens\S_%myTime%_%counter_f%_%A_ScreenWidth%x%A_ScreenHeight%.png
  StringTrimLeft, SitaShotFilename, fileNameDestP, 8


  If (GDIplus_Start() != 0)
     Goto GDIplusError

  ; Copy BMP from DC
  DllCall( "gdi32.dll\BitBlt"
          , "uint", hdc_buffer_full, "int", 0, "int", 0, "int", A_ScreenWidth, "int", A_ScreenHeight
          , "uint", hdc_frame_full,  "int", 0, "int", 0, "uint", 0x00CC0020 )

  DllCall( "GDIplus\GdipCreateBitmapFromHBITMAP", uint, hbm_buffer_full, uint, 0, uintp, bitmap )

  ; Save to PNG

  If (GDIplus_GetEncoderCLSID(pngEncoder, #GDIplus_mimeType_png) != 0)
     Goto GDIplusError

  noParams = NONE
  If (GDIplus_SaveImage(bitmap, fileNameDestP, pngEncoder, noParams) != 0)
     Goto GDIplusError
Return

GDIplusError:
   If (#GDIplus_lastError != "")
      MsgBox 16, GDIplus Test, Error in %#GDIplus_lastError%
   GDIplus_Stop()
Return

#c::
SaveImage:
  counter := counter +1
  FormatTime, myTime, , yyyyMMdd_hhmmss
  fileNameDestP = thumbs\T_%myTime%_%counter%_%thumb_w%x%thumb_h%.png
  If (GDIplus_Start() != 0)
     Goto GDIplusError

  ; Copy BMP from DC
  DllCall( "gdi32.dll\StretchBlt"
          , "uint", hdc_buffer, "int", 0, "int", 0, "int", thumb_w, "int", thumb_h
          , "uint", hdc_frame,  "int", 0, "int", 0, "int", A_ScreenWidth, "int", A_ScreenHeight, "uint", 0x00CC0020 )

  DllCall( "GDIplus\GdipCreateBitmapFromHBITMAP", uint, hbm_buffer, uint, 0, uintp, bitmap )

  ; Save to PNG

  If (GDIplus_GetEncoderCLSID(pngEncoder, #GDIplus_mimeType_png) != 0)
     Goto GDIplusError

  noParams = NONE
  If (GDIplus_SaveImage(bitmap, fileNameDestP, pngEncoder, noParams) != 0)
     Goto GDIplusError
Return


#x::
handle_exit:
   DllCall( "gdi32.dll\DeleteObject", "uint", hbm_buffer )
   DllCall( "gdi32.dll\DeleteDC"    , "uint", hdc_frame )
   DllCall( "gdi32.dll\DeleteDC"    , "uint", hdc_buffer )
ExitApp


I spent some hours making this today and there are several things I'd like to improve and would appreciate some pointers with.

1. I'd like to have one single file, instead of having two .AHK files. What is the easiest way of incorporating GDIPlusHelper.ahk into the main .AHK script?

2. The FTP part is fairly ugly since it exposes your FTP username and password for all to see. I don't personally care much about that, but I would imagine many people do. Does anyone know of an easy way to improve security?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: holomind
PostPosted: February 17th, 2007, 10:21 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
sma wrote:
Is it possible to add the curser pointer to the captured picture ?

You can do it using GetCursorInfo & GetIconInfo (:needed to obtain hotspot) APIs.

And, I think I also saw this question somewhere: can capture transparent windows too using BitBlt with CAPTUREBLT (:0x40000000) ROP.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: SitaShot
PostPosted: February 17th, 2007, 10:23 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Murp|e wrote:
1. I'd like to have one single file, instead of having two .AHK files. What is the easiest way of incorporating GDIPlusHelper.ahk into the main .AHK script?
Look at Image conversions with GDI+, I summarize here the needed functions.

Quote:
2. The FTP part is fairly ugly since it exposes your FTP username and password for all to see. I don't personally care much about that, but I would imagine many people do. Does anyone know of an easy way to improve security?
Laszlo provided encryption functions (TEA and RC4) which you can use to cancel this info from casual viewers. Of course, somebody knowing AutoHotkey can easily change the script to MsgBox the decrypted values: info must be decrypted before being sent to the FTP program! :-)

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


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

All times are UTC [ DST ]


Who is online

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