Images and the Clipboard
[1/13] from: sanghabum::aol::com at: 21-Aug-2001 13:08
Hi all,
Does anyone know how to write a layout to the clipboard?
Mylayout: layout [button "hello" field "goodbye"]
Myimage: to-image Mylayout
write/binary clipboard:// MyImage
does not end up with an image on the clipboard. Not with Windoze anyway.
--Thanks.
--Colin
[2/13] from: petr:krenzelok:trz:cz at: 21-Aug-2001 19:43
----- Original Message -----
From: <[Sanghabum--aol--com]>
To: <[rebol-list--rebol--com]>
Sent: Tuesday, August 21, 2001 7:08 PM
Subject: [REBOL] Images and the Clipboard
> Hi all,
>
> Does anyone know how to write a layout to the clipboard?
>
> Mylayout: layout [button "hello" field "goodbye"]
> Myimage: to-image Mylayout
> write/binary clipboard:// MyImage
myimage doesn't hold image as you probably expect it - bitmap. It is rebol
image datatype, nothing more. You would have to use save it to get real
image .... but then I still don't know how to get it into clipboard ...
Cheers,
-pekr-
[3/13] from: mbicanic:open:hr at: 21-Aug-2001 22:45
Hi Collin,
S> Does anyone know how to write a layout to the clipboard?
S> Mylayout: layout [button "hello" field "goodbye"]
S> Myimage: to-image Mylayout
S> write/binary clipboard:// MyImage
S> does not end up with an image on the clipboard. Not with Windoze anyway.
Try
save/png clipboard:// MyImage
Regards.mb
[4/13] from: sanghabum:aol at: 21-Aug-2001 18:23
Hi MB
[mbicanic--open--hr]
> S> Does anyone know how to write a layout to the clipboard?
> S> Mylayout: layout [button "hello" field "goodbye"]
<<quoted lines omitted: 3>>
> Try
> save/png clipboard:// MyImage
Thanks for the suggestion, but it doesn't work on Windoze. Nor does save/bmp
or some other combinations I've tried. Something gets written, but usually
only a few bytes.
Can anyone paste images to the clipboard on other platforms, or is this a
rebol-wide feature?
--Thanks,
--Colin.
[5/13] from: inetw3:mindspring at: 21-Aug-2001 19:46
Hi Sang,
This is were the power of Rebol shines.
when you clipboard data back and forth
you'll realize you have the ability to use
it as a type of server port for dynamic code.
popup: does [read clipboard://]
Mylayout: view layout [button "hello" field "goodbye"]
write clipboard:// Mylayout
do popup
if user paste data from any program
Rebol can parse it and throw back
an answere visually. You can also
load data back to the clipboard and
do
it from a Rebol script.
[6/13] from: inetw3:mindspring at: 21-Aug-2001 20:23
Oops! wrong code
rebol[]
popup: does [read clipboard://]
hello: "hello"
goodbye: "goodbye"
Mylayout: "view layout [button :hello field :goodbye] "
write clipboard:// Mylayout
do popup
[7/13] from: cyphre:volny:cz at: 22-Aug-2001 10:03
Hi Colin and all,
Looks like the rebol's clipboard port works only with text at least under
WIN98. I tried reverse method: I copied a bitmap from Photoshop into
clipboard and then "read clipboard:\\" and it returned always empty
string...I also tried "open/binary clipboard://" then 'insert or 'copy etc.
but without succes :( Anyone knows solution?
Cyphre
[8/13] from: sanghabum:aol at: 22-Aug-2001 11:29
[cyphre--volny--cz] writes:
> Looks like the rebol's clipboard port works only with text at least under
> WIN98. I tried reverse method: I copied a bitmap from Photoshop into
> clipboard and then "read clipboard:\\" and it returned always empty
> string...I also tried "open/binary clipboard://" then 'insert or 'copy etc.
> but without succes :( Anyone knows solution?
Thanks to Cyphre and everyone else who came forward to help with my question.
Looks like the clipboard is text only, at least in the current release. Of
course it would be extremely useful, and very Rebol-like, if I could pump
images (and possibly other things) down it. I'll drop a line to feedback
--Colin.
[9/13] from: g:santilli:tiscalinet:it at: 21-Aug-2001 21:25
Hello [Sanghabum--aol--com]!
On 21-Ago-01, you wrote:
S> write/binary clipboard:// MyImage
save/bmp clipboard:// MyImage
maybe?
Regards,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[10/13] from: mbicanic:open:hr at: 22-Aug-2001 20:22
Hi Colin,
S>> save/png clipboard:// MyImage
S>>
S> Thanks for the suggestion, but it doesn't work on Windoze. Nor does
S> save/bmp or some other combinations I've tried. Something gets written,
S> but usually only a few bytes.
S> Can anyone paste images to the clipboard on other platforms, or is this a
S> rebol-wide feature?
'Save image to clipboard:// works on Amiga, but 'load from clipboard don't
recognize image... it is not possible to get binary result from clipboard...
mb
[11/13] from: greggirwin:starband at: 22-Aug-2001 14:57
Hi All,
> 'Save image to clipboard:// works on Amiga, but 'load from clipboard don't
> recognize image... it is not possible to get binary result from
clipboard...
I'm new to REBOL, so pardon my ignorance but would it be possible (if
somewhat inefficient) to convert the image to a base 64 string, and write it
to the clipboard that way? Could you then also wrote out a clip-format value
as meta-data for reconversion?
--Gregg
[12/13] from: sanghabum:aol at: 23-Aug-2001 5:38
[greggirwin--starband--net]
> I'm new to REBOL, so pardon my ignorance but would it be possible (if
> somewhat inefficient) to convert the image to a base 64 string, and write
it
> to the clipboard that way? Could you then also wrote out a clip-format
value
> as meta-data for reconversion?
Hi Gregg,
welcome to Rebol, It's fun, fast and frustrating in equal measures.
I've tried loads of combinations of this sort of type, and not hit on one
that works....Rebol often seems more like being lost in a maze than coding.
I think the problem has two halves. First the Clipboard is undocumented (not
in the Rebol Core 2.3 PDF: which doesn't cover View, but is worth downloading
for all the goodies it does contains). That suggests to me that it is a
half-finished feature. "mb" comments that the clipboard will take images on
an Amiga, though not read them back.
Second is probably a Windows issue. I don't know the clipboard API in
Windows, but the clipboard can clearly contain structured data: raw text,
rtf, images, etc. Just writing binary to the clipboard is unlikely to work as
I need to also tell Windows what sort of data is there. And that I don't know
how to do, or even if it is possible. And, of course, my code would no longer
be portable if I bowed to a windows limitation.
All I was trying to do was implement a screen capture routine in such a way
that the user could then paste it straight into another program. As the
Windows/Rebol clipboard doesn't support (as far as I can tell) anything but
text, I've just had to give the user a little more work: I'm writing out a
file instead:
save/png %mytempfile %myimage
--Thanks for the help
--Colin.
[13/13] from: sanghabum:aol at: 18-Sep-2001 14:35
I asked on the list three or four weeks ago how I could save binary data
(images) to the clipboard. I now have the definitive answer from Feedback
which I've copied below
--Colin.
>> It doesn't seem possible to use the clipboard for anything other than text
>> data:
<<quoted lines omitted: 7>>
>>
>> I'd like to be able to send images through to a drawing package. If you
guys
>> find yourselves with a spare afternoon one day, why not have a go at
getting
>>
>> Mylayout: layout [button "hello" field "goodbye"]
<<quoted lines omitted: 7>>
>> the magic words for it.
>>
This is true. The clipboard does not work with binary data right
now. We do have that on our list to do but I can't say when it will
reach high enough on the priority list to become a reality.
I'm sorry I can't give you a magic fix at this time.
REBOL Support
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted