JackDinn Posted April 19, 2009 Share Posted April 19, 2009 (edited) why cant i save the clipboard content to file when its a picture ? _ClipBoard_GetData ($CF_BITMAP ) says it returns a handle to a bitmap, i quote "$CF_BITMAP - Handle to a bitmap (HBITMAP)" but when i try to make it into an image object "$hImage1" it dont work. so how do i save the clipboard to a jpg ? #include <GUIConstantsEx.au3> #Include <GDIPlus.au3> #include <ClipBoard.au3> $fred=ClipGet() if @error = 2 Then $hBitmap=_ClipBoard_GetData ($CF_BITMAP ) $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP ($hBitmap) _GDIPlus_ImageSaveToFile($hImage1,@DesktopDir&"\test_pic.jpg") EndIf Exit thx all. Edited April 19, 2009 by JackDinn Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Authenticity Posted April 19, 2009 Share Posted April 19, 2009 #include <GUIConstantsEx.au3> #Include <GDIPlus.au3> #include <ClipBoard.au3> #include <ScreenCapture.au3> $hGUI=GUICreate("WW") _ClipBoard_Open ($hGUI) $fred=ClipGet() if @error = 2 Then $hBitmap=_ClipBoard_GetData ($CF_BITMAP ) _ScreenCapture_SaveImage(@ScriptDir & '\Testt.bmp', $hBitmap) EndIf Exit Link to comment Share on other sites More sharing options...
JackDinn Posted April 19, 2009 Author Share Posted April 19, 2009 well thx for the pointer , just odd why my method dont work as _ClipBoard_GetData ($CF_BITMAP ) says it returns a hBitmap and as such should be able to be use the same way as any hBitmap? o well, thx for your help Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Authenticity Posted April 19, 2009 Share Posted April 19, 2009 Probably because you didn't use _GDIPlus_Startup()... happens.. ;] Link to comment Share on other sites More sharing options...
JackDinn Posted April 19, 2009 Author Share Posted April 19, 2009 o aye, maybe it was, grr stupid me, but wouldn't be the first time thx again. Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now