Copying text in boxes to clipboard

Jim Lambert jiml at netrin.com
Fri Dec 8 15:46:22 EST 2017


Jacque's suggestion for PDF printing is excellent. That will get you a file.
But you mentioned you want this to end up on the clipboard for pasting into other programs.

> Dunbarx wrote:
> I did a quick test using the "import snapshot" command, and pasted the
> result into another app. It seems to have the same resolution as the img in
> the LC stack. You cannot improve that without a lot of doctoring, of course,
> because that is the resolution of the source.
Well, the relatively new ‘at size’ addition to snapshot might help here.

Charles, try something like this:

An area of your card holds the fields you want to copy. Put that rect of that area into variable myFieldRects
Calculate the width of that rect and place it into variable myRectWidth
Calculate the height of that rect and place it into variable myRectHeight

Now here is where improving the resolution comes in. By using the ‘at size’ parameter you can essentially ‘enlarge' the image you capture.
Just put amount of the enlargement you want into variable multiplier.
Let’s say 10 times.
So altogether we have:
Put "20,100,700,150" into myFieldRects

Put 680 into myRectWidth

Put 50 into myRectHeight

put 10 into multiplier

put the windowID of this stack into winID

export snapshot from rect(myFieldRects) of window winID at size (myRectWidth * multiplier),(myRectHeight * multiplier) to myimg as JPEG

set clipboarddata["image"] to myimg

Paste into, say, a Word doc.

Now change multiplier to 1 - that will give you an ‘unbenlarged’ image.
Now paste that into the same Word doc and look closely at the difference in resolution.

You could try 'as PNG', too.

Jim Lambert


More information about the Use-livecode mailing list