Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

reading an image file into clipboard

44 views
Skip to first unread message

Juge

unread,
Oct 24, 2017, 4:22:45 AM10/24/17
to
I have a commercial software which has a Tcl API. I have a possibility of saving an image from the software into a file - for example in png format.
I would like to use this feature to save the file into the windows clipboard so that I can get easily screenshots of the GUI and transfer them over the clipboard to powerpoint or so.

Now I can use image:
image create photo GUIScreenshotImg -file [file join $tmpDir screenshot.png]

but how can I transfer that to clipboard?

Arjen Markus

unread,
Oct 24, 2017, 6:03:46 AM10/24/17
to
Have you tried the clipboard command?

Regards,

Arjen

Juge

unread,
Oct 24, 2017, 6:52:04 AM10/24/17
to
Yes, well - I am using clipboard for copying text, but I just do not know how a binary data is transfered with the clipboard command so that it is pasted again as a picture in another application, for example Powerpoint.

On the top of that - I would be glad if I could realize this in a platform independent way...

There is something called twapi package but it seems to be only for windows.

Arjen Markus

unread,
Oct 24, 2017, 8:57:16 AM10/24/17
to
Yes, TWAPI is a marvelous package, but it is for Windows only, as it implements interfaces to the Windows system API.

One way out would be to use the clipboard command to do X Window specific things (my guess is that it is geared for that) and use TWAPI for Windows. Hide both in a little OS-independent layer and you're almost there (I do not know how OSX works with such things)

Regards,

Arjen

Harald Oehlmann

unread,
Oct 24, 2017, 11:44:55 AM10/24/17
to
Here is a snipped for windows:
http://wiki.tcl.tk/15647
0 new messages