shrinking a canvas

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

shrinking a canvas

Dave Stevenson-3
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
Reply | Threaded
Open this post in threaded view
|

Re: shrinking a canvas

Steven Kelly

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
Sent: 18 February 2010 01:59
To: [hidden email]
Subject: [vwnc] shrinking a canvas

 

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
Reply | Threaded
Open this post in threaded view
|

Re: shrinking a canvas

Alan Knight-3
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;
         boundary="----_=_NextPart_001_01CAB083.5B5B7F2B"
Content-class: urn:content-classes:message

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] [[hidden email]] On Behalf Of Dave Stevenson
Sent: 18 February 2010 01:59
To: [hidden email]
Subject: [vwnc] shrinking a canvas
 
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

--
Alan Knight [|], Engineering Manager, Cincom Smalltalk

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc