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

Printing in LiveCode

Post by cbeethjr » Mon Mar 20, 2017 7:05 pm

Hey guys, complete beginner here,

I am attempting to have a way for the user to select a certain image that will be displayed on one card, then it will put it into another image field on a different card, and have the option to print the image from there. I tried at "put image into..." but it wouldn't work. Also, I have been searching online for a way to print the image but I haven't found anything that works yet.

Thanks so much!
Clanton

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

Re: Printing in LiveCode

Post by richmond62 » Mon Mar 20, 2017 7:21 pm

I just tried this (LC 8.1.3, Mac OS):

set the imageData of img "PicBOX" to the imageData of img id 1003

but got a very odd result indeed:
Original.png
imageData.png
Not really what you want . . . sorry.

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

Re: Printing in LiveCode

Post by Klaus » Mon Mar 20, 2017 7:26 pm

Hi Richmond,

setting the imagedata of one image to another one REQUIRES to have both images the same dimension (height and width)!


Best

Klaus

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

Re: Printing in LiveCode

Post by Klaus » Mon Mar 20, 2017 7:29 pm

Hi Clandon,

1. welcome to the forum! :D

2.
cbeethjr wrote:I am attempting to have a way for the user to select a certain image that will be displayed on one card, then it will put it into another image field on a different card, and have the option to print the image from there. I tried at "put image into..." but it wouldn't work. Also, I have been searching online for a way to print the image but I haven't found anything that works yet.
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

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

Re: Printing in LiveCode

Post by richmond62 » Mon Mar 20, 2017 7:45 pm

Frankly I'd just use a graphic object and do this sort of thing:

set the backGroundPattern of graphic "picFRAME" to the id of image "SugataMitra" and be done with it:
PicStuff.png
Last edited by richmond62 on Mon Mar 20, 2017 8:45 pm, edited 1 time in total.

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

Re: Printing in LiveCode

Post by Klaus » Mon Mar 20, 2017 8:33 pm

richmond62 wrote:Frankly I'd just use a graphic object and do this sort of thing:
set the backGroundPattern of graphic "picFRAME" to the id of image "SugataMitra"...
Which also requires that the the image and graphic object have identical dimensions to prevent
the display of the "tiles" that setting a backgroundpattern will produce. :D

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

Re: Printing in LiveCode

Post by richmond62 » Mon Mar 20, 2017 8:38 pm

Which also requires that the the image and graphic object have identical dimensions
That's true, but one can resize the graphic either before or after the backGroundPattern is set and the image is OK,
while setting imageData doesn't seem to work that way.
PicStuff2.png
Pictorial Stuff.livecode.zip
Here's the stack.
(210.12 KiB) Downloaded 204 times
All this done with LC 8.1.3 on Mac OS 10.7.5: your mileage may vary :)

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

Re: Printing in LiveCode

Post by Klaus » Mon Mar 20, 2017 9:03 pm

richmond62 wrote:That's true, but one can resize the graphic either before or after the backGroundPattern is set and the image is OK,
while setting imageData doesn't seem to work that way.
I have never said the opposite :D

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

Re: Printing in LiveCode

Post by richmond62 » Mon Mar 20, 2017 9:08 pm

@Klaus
becks1.jpg

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

Re: Printing in LiveCode

Post by Klaus » Mon Mar 20, 2017 9:34 pm

Sorry, no capisce!?

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

Re: Printing in LiveCode

Post by richmond62 » Mon Mar 20, 2017 9:46 pm

German preciseness.
Last edited by richmond62 on Mon Mar 20, 2017 10:37 pm, edited 1 time in total.

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

Re: Printing in LiveCode

Post by Klaus » Mon Mar 20, 2017 10:07 pm

Sure, but I mean the image itself and the "at 4%"! 8)

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

Re: Printing in LiveCode

Post by richmond62 » Mon Mar 20, 2017 10:36 pm

The 4% is the strength of the beer.

My older son who stays in Munchen and prides himself on his Bayerische
can keep everyone quiet for at least 60 minutes with rude comments about Becks.

All I was doing was trying to find a picture, Klaus, that mentioned German Precision.

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

Re: Printing in LiveCode

Post by Klaus » Tue Mar 21, 2017 10:30 am

Ah, OK, get it now!

But I did not recognize anything in the picture but the text! :D

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Printing in LiveCode

Post by jacque » Tue Mar 21, 2017 3:59 pm

German aside, what the OP wants is:

Code: Select all

set the text of img x of cd 2 to the text of img y of cd 1
The quickest way to print is to use "print this card" but that isn't usually what you want. Most of the time you'd want to add the pixel dimensions as parameters. See the dictionary "print card" entry. You might want to use this syntax:

Code: Select all

print card [from topLeft to rightBottom]
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply