Sign in to follow this  
Followers 0
pastl

Copy Pic,... to Clipboard

13 posts in this topic

Hello erverybody,

I found this in the web, but i don't know the language. (Maby C, C++)

could anyone of yo help me to translate this into an AutoIt Script:

'by Alyce Watson

'This little demo shows how to send a bitmap to the clipboard.
'It also shows how to grab a bitmap from the clipboard and
'display it in our Liberty BASIC program.
nomainwin
WindowWidth=340:WindowHeight=480
graphicbox #1.g, 10,10,300,300
statictext #1.s, "",10,320,600,50
open "Clipboard Demo" for window as #1
print #1, "trapclose [quit]"
h=hwnd(#1)

filedialog "Open","*.bmp",bmpfile$
if bmpfile$="" then [quit]

loadbmp "forclip",bmpfile$
hBitmap=hbmp("forclip")'get bmp handle

'open clipboard:
calldll #user32, "OpenClipboard",h as long, result as long

'put bmp data on clipboard:
calldll #user32, "SetClipboardData",_CF_BITMAP as long,_
    hBitmap as long, rethandle as long

'see if bmp data is on clipboard
calldll #user32, "GetClipboardData",_CF_BITMAP as long,_
    hBmp as long

'if bmpdata is on clipboard, load the bmp and draw it
if hBmp<>0 then
    loadbmp "demo",hBmp
    print #1.g, "down;fill lightgray;drawbmp demo 0 0;flush"
end if

calldll #user32, "CloseClipboard", result as void

msg$="Return for CF_BITMAP ";hBmp
print #1.s, msg$

wait

[quit]
if hBmp<>0 then unloadbmp "demo"
close #1:end

I want to copy Pics to cilpboard, but i don't know how to handle this in AutoIt using DllCall. Thank's for your Help.

Greatings pastl

Share this post


Link to post
Share on other sites



what do you want to do with the pic AFTER you copy it to the clipboard??

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Hello Valuater,

after saving in to clipboard, i just want it back , for example with "paste" from the Contexmenu.

P.s. sorry for my english, cause i'm form austria.

Thank's for your help.

pastl

Share this post


Link to post
Share on other sites

Hello Larry,

thank's a lot for your hepl. :lmao:;)

Share this post


Link to post
Share on other sites

Thank's Larry,

just one mor Question:

Why can i just "paste" the Pics from clipboard to an application (like Wordpad,...) and not to a different Folder, Drive,...?

Greatings pastl

Share this post


Link to post
Share on other sites

Thank's Larry,

just one mor Question:

Why can i just "paste" the Pics from clipboard to an application (like Wordpad,...) and not to a different Folder, Drive,...?

Greatings pastl

The picture would need a file name. Windows could theoretically generate one--if I recall correctly, it was possible to save clipboard scraps *.shd files or something--but Windows doesn't do that for pictures....

When you copy and paste a file, the clipboard contains a reference to that file rather than the contents of that file....


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thank's for your answer CyberSlug.

And yes, it was Liberty Basic, soory for that. :">

Share this post


Link to post
Share on other sites

yeah! i was seeking about it! thanks!

there is anyway to put in a jpg file?

Share this post


Link to post
Share on other sites

Do you make a progam that make screenshots ? ^^


-jaenster

Share this post


Link to post
Share on other sites

Do you make a progam that make screenshots ? ^^

Yes i do!

:">

Share this post


Link to post
Share on other sites

Yes i do!

:">

Have you looked at lazycats capture function yet?

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

Have you looked at lazycats capture function yet?

Yes, and i don't see how to put the captured jpg file into clipboard.

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