Printing in LiveCode

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

cbeethjr
Posts: 3
Joined: Mon Mar 20, 2017 6:53 pm

Re: Printing in LiveCode

Post by cbeethjr » Tue Mar 21, 2017 6:46 pm

what exactly do you have problems with?
Let the user select an image file?
"Putting" that user selected image into another image object?
Printing the "other" card with the image?
All of the three?

Best
Klaus
Yes, pretty much all three. I have separate cards, and on one there are images that the user should be able to tap on. From there I would like to change cards to a different card where the image will be displayed, and have the ability to send that image to a printer connected via WiFi and print it.

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Printing in LiveCode

Post by Klaus » Tue Mar 21, 2017 6:58 pm

Okie Dokie :D

Code: Select all

...
## Let the user select a JPEG or PNG image file
answer file "Please select an image file:" with type "Image files|png,jpg|"

## User cancelled
if the result = "Cancel" then
   exit to top
end if

## IT contains the path to the image.
## Since IT will change when you least exspect it, put IT into a variable immediately!:
put it into tImageFile
set the filename of image "the one that will not get printed" to tImageFile

## Now "transfer" the image to the other stack that will get printed, just set its filename to the same path:
set the filename of image "the one that WILL get printed" of cd "print card" of stack "the other stack, if any..." to tImageFile

## Now you can print that card, as already shown by Jaque on the previous page of this thread :-)
...
Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Printing in LiveCode

Post by richmond62 » Tue Mar 21, 2017 7:55 pm

If you download my stack and crack open the script of the "Print" button you
will see that it ONLY prints the picture in the graphic . . .

Post Reply