Scaling printer output

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

Scaling printer output

Carl Gundel-2
What is the simplest way to scale printer output?  I am trying to do something like this, but I don't see any effect.
 
 cg := self getGC getDC.
 cg winHdc  setMapMode: 8 "MmAnisotropic".
 cg setViewportExtent: drawable extent.
 
Thanks,
 
-Carl

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Scaling printer output

Carl Gundel-2
Oh, I got it.
 
 cg winHdc setMapMode: 8 "MmAnisotropic".
 cg winHdc setWindowOrgEx: 0 nY: 0 lpPoint: nil.
 cg winHdc setWindowExtEx: 800 nY: 1050 lpSize: nil.    "original render extent"
 cg winHdc setViewportOrgEx: 0 nY: 0 lpPoint: nil.
 cg winHdc setViewportExtEx: 4800 nY: 6299 lpSize: nil.      "printer page resolution"
 
-Carl

On Friday, June 27, 2014 10:47:29 AM UTC-4, Carl Gundel wrote:
What is the simplest way to scale printer output?  I am trying to do something like this, but I don't see any effect.
 
 cg := self getGC getDC.
 cg winHdc  setMapMode: 8 "MmAnisotropic".
 cg setViewportExtent: drawable extent.
 
Thanks,
 
-Carl

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Scaling printer output

Richard Sargent
Administrator
On Friday, June 27, 2014 1:11:59 PM UTC-7, Carl Gundel wrote:
 cg winHdc setMapMode: 8 "MmAnisotropic".
 cg winHdc setWindowOrgEx: 0 nY: 0 lpPoint: nil.
 cg winHdc setWindowExtEx: 800 nY: 1050 lpSize: nil.    "original render extent"
 cg winHdc setViewportOrgEx: 0 nY: 0 lpPoint: nil.
 cg winHdc setViewportExtEx: 4800 nY: 6299 lpSize: nil.      "printer page resolution"

You will want to be careful about Anisotropic scaling. It will cause distortion in your images. Fortunately, your numbers above are nearly perfectly 6:6. I would suggest you select an Isotropic mode until you know you need anisotropic scaling. 

You probably also want all four upper bounds to be "size - 1". e.g. 'size' pixels are enumerated as 0 .. size - 1

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Scaling printer output

Carl Gundel-2
Thanks Richard.  The application I am porting uses anisotropic scaling, so I will need a good reason to change it.
 
-Carl

On Friday, June 27, 2014 6:45:51 PM UTC-4, Richard Sargent wrote:
On Friday, June 27, 2014 1:11:59 PM UTC-7, Carl Gundel wrote:
 cg winHdc setMapMode: 8 "MmAnisotropic".
 cg winHdc setWindowOrgEx: 0 nY: 0 lpPoint: nil.
 cg winHdc setWindowExtEx: 800 nY: 1050 lpSize: nil.    "original render extent"
 cg winHdc setViewportOrgEx: 0 nY: 0 lpPoint: nil.
 cg winHdc setViewportExtEx: 4800 nY: 6299 lpSize: nil.      "printer page resolution"

You will want to be careful about Anisotropic scaling. It will cause distortion in your images. Fortunately, your numbers above are nearly perfectly 6:6. I would suggest you select an Isotropic mode until you know you need anisotropic scaling. 

You probably also want all four upper bounds to be "size - 1". e.g. 'size' pixels are enumerated as 0 .. size - 1

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Scaling printer output

Richard Sargent
Administrator
On Monday, June 30, 2014 8:40:32 AM UTC-7, Carl Gundel wrote:
Thanks Richard.  The application I am porting uses anisotropic scaling, so I will need a good reason to change it.

I understand. However, if the application itself uses anisotropic scaling AND you allow a second level of anisotropy, your printed output may differ from the previews on screen. The hard-copy should faithfully reproduce the model.

However, in your case, the scaling factors you use are effectively isotropic and so not really a problem. (Other than the "range too big by 1", previously mentioned.)

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.