Greenhorn Posted January 21, 2008 Share Posted January 21, 2008 (edited) Moin, I want to copy an Image or Picture - png, gif, jpg - to the Clipboard, so I played around with _ClipPutFile() and _Clipboard_SetData(), but everything failes. With Bitmaps it is no problem, so what's the thing that makes these formats so difficult to handle ?! I tried _Clipboard_SetData() with $CF_BITMAP and $CF_METAFILEPICT with the same results: No go ! #include<Clipboard.au3> $file = "C:\test.jpg" _ClipBoard_Open(0) _ClipBoard_Empty() _ClipBoard_SetData($file, $CF_METAFILEPICT) ; failes _ClipBoard_Close() _ClipPutFile($file) ; failes also I found a Topic here to get a Picture to the Clipboard, by creating an Object, but it also didn't work in my tests ... Could anybody give me a tip how to get a png, gif or jpg to the Clipboard, please ? Greetz Greenhorn Edited January 21, 2008 by Greenhorn Link to comment Share on other sites More sharing options...
james3mg Posted January 21, 2008 Share Posted January 21, 2008 (edited) Could anybody give me a tip how to get a png, gif or jpg to the Clipboard, please ?First, let me just say, I don't know.I just want to clear up some confusion I have about your question so I know what you're trying to do: Are you trying to put a file that is a .jpg on the clipboard so you could paste it elsewhere (like in explorer), or are you trying to put the data of the .jpg image itself on the clipboard so you could paste it into a program (like paint)? I think there's a significant difference between these two things... (though I could be wrong here too). Edited January 21, 2008 by james3mg "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110 Link to comment Share on other sites More sharing options...
Greenhorn Posted January 21, 2008 Author Share Posted January 21, 2008 First, let me just say, I don't know.I just want to clear up some confusion I have about your question so I know what you're trying to do: Are you trying to put a file that is a .jpg on the clipboard so you could paste it elsewhere (like in explorer), or are you trying to put the data of the .jpg image itself on the clipboard so you could paste it into a program (like paint)? I think there's a significant difference between these two things... (though I could be wrong here too).I want to paste the Picture into other Progs like Paint or any other Application, but the first possibility is also interesting.How could I put the Data of an Image to the Clipboard ? That's the main question that tortures me ! Greetz Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 22, 2008 Share Posted January 22, 2008 I want to paste the Picture into other Progs like Paint or any other Application, but the first possibility is also interesting.How could I put the Data of an Image to the Clipboard ? That's the main question that tortures me ! GreetzHI,yes. I would also like to know how to say clipboard - hey ho now there comes a jpg or png or something. And after it, I can paste it to word, excel, msapint or some other programm that does understand that. It works when I am using a screenshot tool, but how does a screenshottool store the data into clipboard? Is this even possible from file or do I always have to show the pic on screen and then put it into clipbaord?Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Greenhorn Posted January 22, 2008 Author Share Posted January 22, 2008 Hi Mega, you know where the original post is from, didn't you ? O.K., I took a deeper look into _ClipBoard_SetData and I think it's possible with _GDIPlus_ImageLoadFromFile. But how do I create a $hMemory from the returned _GDIPlus_ImageLoadFromFile ??? #include<Clipboard.au3> #Include <GDIPlus.au3> $sFileName = "J:\Eigene Dateien\Eigene Bilder\Diverses\AutoIt3port.jpg" _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($sFileName) _ClipBoard_Open(0) _ClipBoard_Empty() _ClipBoard_SetData($hImage, $CF_METAFILEPICT ) ; failes _ClipBoard_Close() _GDIPlus_ShutDown() Any experiences and/or ideas out there ? Greetz Greenhorn Link to comment Share on other sites More sharing options...
Greenhorn Posted January 23, 2008 Author Share Posted January 23, 2008 Hmmm, is nobody familiar to the Functions above ??? Link to comment Share on other sites More sharing options...
blademonkey Posted January 23, 2008 Share Posted January 23, 2008 i dun ewz fansee picturs ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
Greenhorn Posted January 23, 2008 Author Share Posted January 23, 2008 (edited) i dun ewz fansee pictursCan you translate this in english, please !?! Sorry: Cnya trlt ts in engsh, plz !?! Edited January 23, 2008 by Greenhorn Link to comment Share on other sites More sharing options...
JackDinn Posted August 22, 2010 Share Posted August 22, 2010 So did this question ever get an answer ? Im stuck with exactly the same problem. this was asked some 2 years ago so im assuming there was an answer that im just not finding on the forum. Anyone , pls Many thx. 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