Page 1 of 2

Printing in LiveCode

Posted: Mon Mar 20, 2017 7:05 pm
by cbeethjr
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

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 7:21 pm
by richmond62
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.

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 7:26 pm
by Klaus
Hi Richmond,

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


Best

Klaus

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 7:29 pm
by Klaus
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

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 7:45 pm
by richmond62
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

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 8:33 pm
by Klaus
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

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 8:38 pm
by richmond62
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 :)

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 9:03 pm
by Klaus
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

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 9:08 pm
by richmond62
@Klaus
becks1.jpg

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 9:34 pm
by Klaus
Sorry, no capisce!?

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 9:46 pm
by richmond62
German preciseness.

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 10:07 pm
by Klaus
Sure, but I mean the image itself and the "at 4%"! 8)

Re: Printing in LiveCode

Posted: Mon Mar 20, 2017 10:36 pm
by richmond62
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.

Re: Printing in LiveCode

Posted: Tue Mar 21, 2017 10:30 am
by Klaus
Ah, OK, get it now!

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

Re: Printing in LiveCode

Posted: Tue Mar 21, 2017 3:59 pm
by jacque
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]