How can I print all parts of oversize cards!....desperately !

J. Landman Gay jacque at hyperactivesw.com
Mon Nov 14 18:19:38 EST 2005


Kresten Bjerg wrote:
> Dear Jacqueline
>  
> As you see from my first posting - and from the last- it is only the problem of printing a single snapshot from
>  a visible window ( past horizontal 2000) of a large card.
> We have been trying to follow your suggestion of :
> "... importing... snapshot(s) to a buffer stack and then printing the buffer's card should work.....",
>  but we get stuck. 
> We have succesfully exported a snapshot from a (visible) part of a card into a container named screenbuff,
>  which seems to contain binary image data. But we cant suceed in putting this into a screensize  image ("bufferimage") 
> for that purpose on the buffer-stack. 
> Using "set the imagedata of image "bufferimage" to screenbuff results in an extremely distorted image...
> How should the scripting go to suceed in putting such a screen snapshot into the screensize  image in the bufferstack  ?
> Please !
>  
> P.S.  : is the limitation to horizontal 2000 for printcard  known - a discussed issue...a bug ?....the result of a decision ?

There's been some discussion about the limitation, which apparently 
occurs only on OS X. Here is one post about it:

<http://lists.runrev.com/pipermail/use-revolution/2004-October/046011.html>

You may have to try tiling the image. That is, create several snapshots 
instead of just one, and then import them as separate images and set 
their edges to touch.

There are several ways to bring images into a stack.

1. You can create a blank image and then set its imagedata from a file 
on disk as you are doing now. This stores the image data in the stack 
and increases stack size, so you'll want to empty the images when you 
are done with them. ("set the imagedata of img 1 to empty").

2. An easier way to deal with several images is just to import them 
directly:

   import paint from file "mySnapshot.jpeg"

This also increases stack size, so delete or empty the stack images when 
you are done. You may also want to remove the snapshot files on disk 
("delete file <path to file>").

3. Create image objects in advance, and set their filenames to the image 
paths on disk. This is called a "referenced" image. It does not increase 
stack size because the image data is not stored in the stack. The images 
remain on disk, however, so you may want to delete them when done 
("delete file <path to file>").

If you decide you need to tile the images to get them to print, then 
take two or three snapshots of the screen, dividing it into halves or 
thirds. When you want to print, bring them into your buffer stack using 
one of the above methods. For example, using method #2 with 2 images:

set the defaultstack to "BufferPrintStack"
import paint from file "snapshot1.jpg" -- you may need a full path here
set the topleft of img ""snapshot1.jpg"" to 0,0 -- or wherever
import paint from file "snapshot2.jpg"
set the topleft of last img to (the top of img "snapshot1.jpg",the right 
of img "snapshot1.jpg")

If you are setting the filenames of pre-existing image objects, then you 
can align them beforehand in the IDE and just set their filenames when 
you are ready to print.

That said, I wonder why you want to print an actual screen image. If you 
are printing diary information, wouldn't it be better to print just the 
text? Will your users really want a printout of all the buttons and 
window borders?

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



More information about the use-livecode mailing list