Jump to content

Recommended Posts

Posted (edited)

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.

Posted (edited)

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
  • 2 weeks later...
Posted

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

Posted

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
  • 4 months later...
Posted

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

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
  • Recently Browsing   0 members

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