card printing question???

J. Landman Gay jacque at hyperactivesw.com
Wed Jul 20 12:56:45 EDT 2005


Ban Nguyen wrote:
> Hello everyone,
> 
> I have a gif image size 350 x 500.  I want to display it in the field so
> user can scroll up and down to view it and print the whole image out.
> 
> This is what I have done:
> I create a field and insert this code into the field:
> 
> on openCard
>   set the imageSource of char 1 of field "myField" to "myImage"
> end openCard
> 
> 
> --->  the field displays the image perfectly the way I want it.
> 
> I also create a button (Print) on the same card.  I insert this code
> into the Print button:
> 
> on mouseUp
>   revPrintField the name of field "myField"
> end mouseUp

The revPrintField command prints the text of a field. I'm not sure why 
it says there is no such object, though.

You should not put the image into a field if you want to print it. 
Instead, put the image on the card and group the image. Then make the 
group the size you want, set its locklocation to true, and add vertical 
and horizontal scrollbars. Then your user can scroll it around.

To print it, use "print this card from x1,y1 to x2,y2". The visible part 
of the image will print. You might want to make a printing substack that 
is large enough to hold the entire image, and then just print that 
instead. If you print from the scrolling group, only the visible part of 
the image inside the group will print, so you need a big card to print 
that will hold the entire image at once.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list