Sign in to follow this  
Followers 0
Joon

Save Screen Print To Graphic File

11 posts in this topic

How can I create jpeg or gif from screen print? I guess using MSPaint is oneway. Is there better way of doing this?

Share this post


Link to post
Share on other sites



How can I create jpeg or gif from screen print? I guess using MSPaint is oneway. Is there better way of doing this?

there is a script in scripts and scraps called "Spraypaint" that takes an image from paint. it does it using dll calls though. you can probably get going in the right direction that way.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

How can I create jpeg or gif from screen print? I guess using MSPaint is oneway. Is there better way of doing this?

I am using HoverSnap to capture PrintScreen/Alt+Printscreen or Ctrl+PrintScreen (Custom area) and save it to PNG or JPG..

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Go http://www.autoitscript.com/fileman/users/Lazycat/ and you will find a way using a dll by Lazycat.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Go http://www.autoitscript.com/fileman/users/Lazycat/ and you will find a way using a dll by Lazycat.

i made this with lazycats dll

#include "GUIConstants.au3"
$CLoc =  @TempDir & "\"
$CFile = "Dumppic.jpg"

$CProgram = $CLoc & "captplugin.dll"
FileInstall("C:\Program Files\AutoIt3\Examples\My Stuff\captplugin.dll", $CProgram)

Dim $pic
_GuiCreater()

While 1
    sleep(5000)
    _get_pic()
WEnd


Func _get_pic()
$hPlugin = PluginOpen($CProgram)
CaptureScreen($CLoc & $CFile, 85)
PluginClose($hPlugin)
GUICtrlSetImage( $pic, $CLoc & $CFile)
EndFunc

Func _GuiCreater()
    GUICreate("My Pic", 200, 200, 10, 10, $WS_POPUP, $WS_EX_TOPMOST )
    $pic = GUICtrlCreatePic($CLoc & $CFile, 0, 0, 200, 200)
    GUISetState()
EndFunc

you might get an error with a missing function... just press continue because the function is inside the dll

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Here is the example from Lazycats site

HotKeySet("{F9}", "OnScreenShot")
HotKeySet("{ESC}", "Terminate")

While 1
    Sleep(20)
WEnd


Func OnScreenShot()
    If Not FileExists (@scriptdir & "\screenshots") Then DirCreate (@scriptdir & "\screenshots") 
    If Not FileExists(@scriptdir & "\captdll.dll") Then FileInstall( "captdll.dll", @scriptdir & "" ,1)
    Local $Cwin1 = WinGetHandle(""); gets the handle of the active window
    Local $Cwin2 = WinGetPos($Cwin1); gets active window dimensions
    Local $Quality = 85; use -1 to save as BMP or use number between 0 - 100 to save as JPG quality
    If $Quality = -1 Then
        Local $SaveAs = ".bmp"
    Else
        Local $SaveAs = ".jpg"
    EndIf   
    Local $CaptureDirectory = @ScriptDir & "\Screenshots\"; directory uses to store screen caps
    Local $CaptureFile = @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & @MIN & "-" & @SEC & $SaveAs
    DllCall(@scriptdir & "\captdll.dll", "int", "CaptureRegion", "str", $CaptureDirectory & $CaptureFile, "int", $Cwin2[0], "int", $Cwin2[1], "int", $Cwin2[2], "int", $Cwin2[3], "int", $Quality)
    If @error Then MsgBox(262160,"ERROR","The screen was not captured",4)
EndFunc


Func Terminate()
    Exit
EndFunc

And attached is the required dll



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

my example gets a full screen

and lazycats example gets the active window

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

there is a script in scripts and scraps called "Spraypaint" that takes an image from paint. it does it using dll calls though. you can probably get going in the right direction that way.

Spraypaint does nothing about screen print or saving file.

Share this post


Link to post
Share on other sites

looks like lazycatz dll will do the trick.

Thanks everyone.

HoverSnap is cool tool. but, just little be too big and no support for commandline.

Share this post


Link to post
Share on other sites

my example gets a full screen

and lazycats example gets the active window

8)

Sorry posted wrong example

DllCall("captdll.dll", "int", "CaptureScreen", "str", "dump_full.jpg", "int", 85)

Leaves a jpg file in the script folder called dump_full.jpg



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Sorry posted wrong example

Actually, that is what i needed... :think: Active window capture.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0