[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Multiple Page LGP2 graphics output.
Mike McMahon posted this response to a similar question in March.
What follows is some code I used to hardcopy displayed presentations
from a dynamic window...
Date: Thu, 1 Mar 90 20:32 EST
To: RUSHING@TITAN.KSC.NASA.GOV
cc: SLUG@Warbucks.AI.SRI.COM
In-Reply-To: <900301161905.0000015C0B1@TITAN.KSC.NASA.GOV>
Message-ID: <19900302013240.4.MMCM@MOTH.Oberon.Dialnet.Symbolics.COM>
Date: Thu, 1 Mar 90 16:19:05 EDT
From: RUSHING@TITAN.KSC.NASA.GOV
We don't have the code for format-graph-from-root here, so I
have no idea how it's done... any clues out there? Thanx!
There's a special kind of stream that buffers multiple pages of graphics.
The simplest way to access it is via dw:do-redisplay, as format-graph-from-root does.
Wrap dw:redisplayer around your code, and call
(dw:do-redisplay <displayer> <hc-stream>
:full-set-cursorpos :graphics :once-only t).
---------------------------------------------------------------------------
;;; -*- Mode: LISP; Syntax: Common-lisp; Package: METERS; Base: 10 -*-
(defmethod (HARDCOPY-ALL-OBJECTS GOBJECT-WINDOW) () ;&optional (scale-factor 1))
"Hardcopies all gobjects to a printer that supports graphics (LGP2 - PS)"
(let ((hardcopy-stream))
(unwind-protect
(progn
(setf hardcopy-stream
(hardcopy:make-hardcopy-stream
(dw:accepting-values
(() :own-window t :temporary-p t :label "Enter A Printer")
(accept 'dw::local-printer :prompt "Printer "))
)
)
(dw:do-redisplay
(dw:redisplayer (hardcopy-stream)
; (graphics:with-room-for-graphics (hardcopy-stream)
; (graphics:with-graphics-scale (hardcopy-stream scale-factor)
(dolist (object (reverse (GOBJECT-WINDOW-objects self)))
(DRAW object hardcopy-stream))
)
; )
; )
hardcopy-stream
:full-set-cursorpos :graphics
:once-only t
)
)
(close hardcopy-stream)
)
)
)
;;(dw:do-redisplay (dw:redisplayer (*stream*) (clear-and-refresh-all-objects (tv:window-
;; under-mouse))) *stream* :full-set-cursorpos :graphics :once-only t)
;;; ripped out the graphics translations because they don't work all that well... especially
;;; text: it comes out upside down, scaled all wrong, and sometimes even mirror-imaged, very confusing display.