How to Turn a Word Into a Graphic Object?
Michael Doub
mikedoub at gmail.com
Sat Mar 28 11:12:09 EDT 2015
I noticed that there is a lock screen command but no unlock screen in
Jim's handler. Was that done deliberately?
-= Mike
On 3/28/15 10:38 AM, Richard Gaskin wrote:
> Brahmanathaswami wrote:
>
>> Also: I don't see how this (in the docs on snapshot) can apply for
>> snapshots of words in a field as these are not "objects" perse:
>>
>> " You can take a snapshot of an object regardless of its visibility
>> or open status - in particular, snapshots can be taken of objects
>> that are not on the current card or in stacks that are not open.
>>
>> an attempt like this results in "empty rectangle"
>>
>> on MouseUp
>> repeat with x = 1 to the number of words of fld _Quote of cd 2
>> put the formattedRect of word x of fld _Quote of cd 2 into
>> tNextWordSnapshot
>> import snapshot from rect tNextWordSnapshot of cd 2
>> set the name of the last image to ("word_"&x)
>> end repeat
>> end MouseUp
>>
>> Also if you turn the vis of the field off... you get snaps shots of
>> whatever is visible on the card, not the words in the field...
>
> That script uses the older "from rect" option, which obtains the image
> area from the final composite screen buffer. It's truly WYSIWYG: if
> it ain't visible, it ain't gonna be seen in the resulting the image.
>
> The newer "from <object>" option is much smarter and more flexible,
> allowing you to capture any object (control, group, or even an entire
> card) whether it's open or not.
>
> It does this by rendering the object into its own image buffer, and
> returns the resulting image data to the newly created image object.
>
> And because it renders into its own buffer, the "from <object>" option
> also maintains blending/transparency, so the resulting object will
> retain empty areas as empty, in many cases making it much more useful
> to using the resulting image as part of other layouts.
>
> Jim's script posted yesterday at
> <http://lists.runrev.com/pipermail/use-livecode/2015-March/213144.html> creates
> a new field object and obtains the snapshot using the newer "from
> <object>" option, which will not only handle what you need but also
> preserve empty space as transparent.
>
> The only modification I would suggest for Jim's script is to use
> htmlText rather than rtfText.
>
> RtfText will handle only the subset of LiveCode text attributes that
> are also supported by the RTF spec, which is good for most things but
> may miss a few elements unique to LiveCode (see the note in the
> Dictionary entry for rtfText).
>
> HtmlText is designed to provide complete fidelity of all field
> contents and attributes in a plain-text format, making it the go-to
> solution for moving field contents, while RtfText is ideally suited
> for export for use in Word processors and the like.
>
>
> Extra bonus points: if you ever need to create a thumbnail view of an
> object, see the new "at" options for specifying the width and height
> of the resulting snapshot. MUCH faster than the scripted solutions we
> used to use, and very convenient.
>
>
>> If I'm write.. then perhaps we need to update the docs...(Richard/Dan...
>> is the framework for use contributions to the documentation in MarkDown
>> ready yet?)
>
> I think this entry for the Dictionary may be fine - try the "from
> <object>" option and see how it goes. If you do find errors there
> please file a bug report and we'll catch them.
>
> The Community Documentation Team is growing rapidly (thanks to all
> those who've written offering to help), and once Ben and I work out
> some scheduling challenges we've had we'll put together a work plan to
> get that started.
>
>
> And as long as this is in your sigline:
>> Kauai's Hindu Monastery
>> www.HimalayanAcademy.com
>
> If any of you are visiting Kauai you really should reserve time in
> your schedule to visit the monastery. It's a beautiful place,
> breathtaking really, and the people who live and work there even
> better. When I was there they had public tours scheduled each Friday;
> check their current schedule, and go. You will leave with a deep
> admiration for the uncommonly wonderful work environment
> Brahmanathaswami gets to enjoy every day. :)
>
More information about the use-livecode
mailing list