Copy bitmap to clipboard

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Copy bitmap to clipboard

HilaireFernandes
Hi,

A Dr. Geo user asked me about copying a DrGeo canvas view in the system
clipboard, to past it in other tools as a text writer or any other
editing tool.

I looked in Pharo3 and Pharo6, I found text clipboard operation but it
is not clear if there is support for other format?

What about
primAddClipboardData:data:dataFormat:

I would like to copy and paste the DrGeo canvas as PNG content.

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Copy bitmap to clipboard

Peter Uhnak
I don't know about other platforms, but on linux the clipboard is implemented in this 8kloc C file https://github.com/pharo-project/pharo-vm/blob/e0ce2d9d78c3c7b37bbc12cd8730c6a15f1f057c/opensmalltalk-vm/platforms/unix/vm-display-X11/sqUnixX11.c


From the comments around the code I gather that the author(s) were aware that images can be copied around in clipboard. Whether it actually works I do no know.

(it would be if the clipboard-related code wrote itself into a nice separate file/plugin :))

Peter



On Thu, Jun 15, 2017 at 4:00 PM, Hilaire <[hidden email]> wrote:
Hi,

A Dr. Geo user asked me about copying a DrGeo canvas view in the system
clipboard, to past it in other tools as a text writer or any other
editing tool.

I looked in Pharo3 and Pharo6, I found text clipboard operation but it
is not clear if there is support for other format?

What about
primAddClipboardData:data:dataFormat:

I would like to copy and paste the DrGeo canvas as PNG content.

--
Dr. Geo
http://drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: Copy bitmap to clipboard

Stephane Ducasse-3
Hilaire

may be you should turn the copied canvas into a png because it is not
clear how external tools will be able to
do something with an internal representation of the screen.

Stef

On Sun, Aug 27, 2017 at 6:18 PM, Peter Uhnák <[hidden email]> wrote:

> I don't know about other platforms, but on linux the clipboard is
> implemented in this 8kloc C file
> https://github.com/pharo-project/pharo-vm/blob/e0ce2d9d78c3c7b37bbc12cd8730c6a15f1f057c/opensmalltalk-vm/platforms/unix/vm-display-X11/sqUnixX11.c
>
> e.g. getting the selection
> https://github.com/pharo-project/pharo-vm/blob/d06aa80a38bc1b6d1f4cc54301eca855273c3205/opensmalltalk-vm/platforms/unix/vm-display-X11/sqUnixX11.c#L902
>
> From the comments around the code I gather that the author(s) were aware
> that images can be copied around in clipboard. Whether it actually works I
> do no know.
>
> (it would be if the clipboard-related code wrote itself into a nice separate
> file/plugin :))
>
> Peter
>
>
>
> On Thu, Jun 15, 2017 at 4:00 PM, Hilaire <[hidden email]> wrote:
>>
>> Hi,
>>
>> A Dr. Geo user asked me about copying a DrGeo canvas view in the system
>> clipboard, to past it in other tools as a text writer or any other
>> editing tool.
>>
>> I looked in Pharo3 and Pharo6, I found text clipboard operation but it
>> is not clear if there is support for other format?
>>
>> What about
>> primAddClipboardData:data:dataFormat:
>>
>> I would like to copy and paste the DrGeo canvas as PNG content.
>>
>> --
>> Dr. Geo
>> http://drgeo.eu
>>
>>
>