Question

I need to be able to take some variable text entered by the user and merge it with a "template" image to create a single image as PNG (or other). Can this be done with Livecode?

Was it helpful?

Solution

There are several ways to do this. One way is to create a transparent field on top (or in front) of an image and group them. Give this group the name "Caption". Then use this script:

export snapshot from group "Caption" to myPictureData as PNG

Now you can create a new image and set the text of the image to myPictureData or save myPictureData to a file.

OTHER TIPS

If all you need is an image in your stack, the import snapshot command is a great option:

import snapshot from group "imgAndFld" with effects

The optional 'with effects' clause will preserve any graphic effects you have applied to the imported objects, important if you want your text to have a drop shadow or glow effect, for example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top