On Nov 30, 2005, at 12:36 PM, Asher Dunn wrote:
Abstract the drawing interface to render to screen or PDF based on a
variable?
I would say the easiest way would be to draw to either a Graphics
object (screen) or PDFGraphics object (PDF). Unfortunately, you
would have to duplicate code to accept either Graphics or
PDFGraphics, as I cannot effectively subclass Graphics.
I was planning on doing something like this... basically I was
planning to write a GraphicsWrapper Class which manually duplicated
all of the public methods of the Graphic class, except instead of
accepting Integer values for position, I would take Doubles and also
add a scale factor.
I thinking about adding a stack of drawing commands so that if the
scale changes the current stack could be redrawn automatically. The
only issue I have with a stack are Picture objects since the same
Picture object could look entirely different 5 minutes later... which
means keeping a copy of every Picture drawn to the stack and that
could get memory intensive.
My goal (like so many others in this thread) was to make an API that
allowed WYSIWYG drawing that could be rendered to screen or printer
always at optimum resolution/position.
Like so many of my other projects, I have spent a lot of time
thinking about this but I haven't been able to set down and start
coding. It sounds like there is enough of us interested that we
might be able to do a collaborative project.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|