I want to do a print preview window. I have a large subcanvas that will be printed on a large format roll printer. I want to shrink down this subcanvas to fit on the screen in the print preview window.
I've seen ScalingWrapper used to shrink a window's component for printing, but does anyone have example code to shrink a subcanvas for display on the screen, possibly in a view holder? Dave Stevenson[hidden email] _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
VW’s printing graphics contexts support scaling, but
screen graphics contexts don’t. GF/ST Base adds GFScalingPen, a screen
graphics context that supports scaling. It generally only has GF/ST graphic
objects in it, but you might find other displayable objects work there too. What
kind of objects are you displaying? Another approach would be WinGDIPlusInterface (if you’re
on Windows) or Cairo: draw to a big Pixmap, and then use these to scale that
down with anti-aliasing. If your initial Pixmap is really big, you’ll
probably hit problems with memory allocation (primitiveFailed in Pixmap class>>extent:).
The size at which problems occur depends on the graphics card, of all things,
because VW (on Windows) always allocates graphics card memory (DDB?) for
Pixmaps. Windows applications generally use main memory (DIB?), or at least don’t
demand graphics card memory, so they don’t run out. HTH, Steve From:
[hidden email] [mailto:[hidden email]] On Behalf Of Dave
Stevenson I want to do
a print preview window. I have a large subcanvas that will be printed on a
large format roll printer. I want to shrink down this subcanvas to fit on the
screen in the print preview window. I've seen
ScalingWrapper used to shrink a window's component for printing,
but does anyone have example code to shrink a subcanvas for display on the
screen, possibly in a view holder? Dave
Stevenson _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
I'm pretty sure I've done this before, but it was <deep
sigh> decades ago at this point, so I'm kind of fuzzy on the details.
I may have just implemented my own scaling graphics context.
At 05:15 AM 2010-02-18, Steven Kelly wrote: Content-Type: multipart/alternative; --
Alan Knight [|], Engineering Manager, Cincom Smalltalk
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |