Jump to content

using ClipGet on an image?


Recommended Posts

when u copy some text or w/e it is saved in clipboard.

ex: i copy "dsadsa" and saved in clipboard, the below program shows this and checks if u copy smt in every 0.25secs

while 1
$commands = ClipGet()
Tooltip($commands,2,2  )
sleep(250)
wend

now i wonder if i copy an image using printscreen. copied image is also saved in clipboard (i think).

how can i read the values of the image which is saved in clipboard?

tnx for answering

Edited by altamir

TY.

Link to comment
Share on other sites

Using Auto3Lib to capture screen, paste to clipboard, open Paint, paste:

; Capture to clipboard
$hBMP = _ScreenCap_Capture("")
_Clip_SetData($hBMP, $CF_BITMAP)
; Run paint and paste the image
Run("MSPaint.exe")
WinWaitActive("untitled - Paint")
Send("!eP")

:)

Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

  • 2 weeks later...

when u copy some text or w/e it is saved in clipboard.

ex: i copy "dsadsa" and saved in clipboard, the below program shows this and checks if u copy smt in every 0.25secs

while 1
$commands = ClipGet()
Tooltip($commands,2,2  )
sleep(250)Ù[

now i wonder if i copy an image using printscreen. copied image is also saved in clipboard (i think).

how can i read the values of the image which is saved in clipboard?

tnx for answering

I also tried to find solution with this issue, but failed.

I found one command line small utility can help on this way.

it call "ClipboardToImage", you could seach it on google.

Payne

Link to comment
Share on other sites

I also tried to find solution with this issue, but failed.

I found one command line small utility can help on this way.

it call "ClipboardToImage", you could seach it on google.

Payne

As the post right above yours shows, you can use Auto3Lib to put images on the clipboard. You can also read an image from the clipboard and save it to disk. I believe that is what the OP was asking for and it's all done in AutoIt code.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I know that Auto3Lib is able to do that, but incase you're looking for something else, read this thread:

http://msdn2.microsoft.com/en-us/library/y...efc(VS.80).aspx

Kurt

VB? Ugh! :rolleyes: I think if you peeked inside of VB you'd see that it's making the same API call to the clipboard that Auto3Lib makes. To each his own though. :rambo:
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

  • 4 months later...

What am I doing Wrong? (why won't it paste image)

#include <A3LClipboard.au3>

Send('!{PRINTSCREEN}')
Sleep(1000*2)
$lastclip = ClipGet()
Local $clipType
If @error=2 Then 
    $clipType = 'image'
    $lastclip =_Clip_GetData($CF_BITMAP)
ElseIf @error > 2 Then
    ConsoleWrite('Msg: '& 'clipget unknown handling of errorcode '& @error & @CRLF)
    $clipType = 'unknown'
Else
    $clipType = 'text'
EndIf

If $lastclip = '' Then ConsoleWrite('Lastclip Var: '& 'nothing in lastclip var' & @CRLF)

Run('"C:\Program Files\Windows NT\Accessories\wordpad.exe"',"C:\Program Files\Windows NT\Accessories\")
ClipPut('Test Msg')

$WinTitle='Document - WordPad'
WinWaitActive($WinTitle)
ConsoleWrite('ClipType: '& $clipType &@CRLF)
If $clipType = 'text' Then
    ClipPut($lastclip)
Else
    _Clip_SetData($lastclip, $CF_BITMAP)
EndIf
Sleep(1000*3)
ConsoleWrite('Clipboard: '&$lastclip &'-:' & @CRLF)
If $lastclip = '' Then ConsoleWrite('Msg: '& 'nothing in lastclip var' & @CRLF)
ControlSend($WinTitle,'','RICHEDIT50W1','^v')
A decision is a powerful thing
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...