Jump to content

clip board save to file problem


Recommended Posts

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 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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...