[REBOL] Re: Capturing transparent faces.
From: carl:cybercraft at: 26-Jun-2005 12:22
On Sunday, 26-June-2005 at 1:30:49 Volker Nitsch wrote,
>> >Pekr, if you continue at that pace, you will be guru shortly ;)
>> >And the solution is:
>> >You can show things without viewing them.
>> >That forces /view to paint into the internal buffers.
>> >A to-image just dumps these buffers, without a 'show there is just black
>.
>> >So
>> >
>> >!>> lo: layout [
>> >[ title "Grab area test."
>> >[ at 30x20
>> >[ b: box 80x30 with [color: none] ; Transparent box.
>> >[ button "Grab Area" [
>> >[ window-grab: to-image b
>> >[ unview/all
>> >[ ]
>> >[ ]
>> >!>> show lo
>> >; ^^^^^^^^!!!!!!!!!
>> >!>> lo-grab: to-image lo
>> >== make image! [220x102 #{
>> >C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8
>> >C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C8C...
>> >!>> view layout[image lo-grab]
>>
>> Thanks Volker (and Petr), but that still doesn't do what I want, which is
> to capture 'b, not 'lo.
>>
>
>Tried a bit, quite confusing. found two ways:
>1) One was with 'view, grabbing the face itself does not work without it.
>2) But what you can do is:
> lo-grab: copy/part at to-image lo 30x20 80x30
>(note you have to get it from the whole layout, not just the box)
>Easier than those numbers to exact face-content:
> lo-grab: copy/part at to-image lo b/offset b/size
Ah - that did the trick! In View 1.3, anyway. (AT, and perhaps COPY, have obviously
been improved to cope with the new View.)
Thank you!
-- Carl Read.