[comp.sys.mac.programmer] QuickDraw Scaling

csparr@cybaswan.UUCP (Jason Parr) (05/30/90)

In QuickDraw you can translate the co-ordinate system, is there any way to
scale the co-ordinate system by some factor with LineTo, TextSize etc scaled
appropriately?

One way I thought of doing this was by overriding the standard QuickDraw
procedures. Is this the correct way to do this or is there an easier method?

Thanks in Advance


-- 
  _____   ___   ____     Jason Parr	    Janet: csparr@uk.ac.swan.pyr  
    /    /__/  /___	 U.C. of Swansea    ARPA:  csparr@pyr.swan.ac.uk
 __/    /  /   ___/	 Wales. U.K.	    

casseres@apple.com (David Casseres) (06/01/90)

In article <1861@cybaswan.UUCP> csparr@cybaswan.UUCP (Jason Parr) writes:
> In QuickDraw you can translate the co-ordinate system, is there any way
> to scale the co-ordinate system by some factor with LineTo, TextSize
> etc scaled appropriately?
> 
> One way I thought of doing this was by overriding the standard QuickDraw
> procedures. Is this the correct way to do this or is there an easier
> method?

That's a perfectly good way to do it; another is to draw stuff into a 
picture, using a picFrame rectangle of some size in the OpenPicture call, 
and then drawing the picture with a dstRect rectangle of a different size 
in the DrawPicture call.  QuickDraw will scale everything in the picture 
in such a way as to make the picFrame match the dstRect.

David Casseres
     Exclaimer:  Hey!

aries@rhi.hi.is (Reynir Hugason) (06/01/90)

> That's a perfectly good way to do it; another is to draw stuff into a
> picture, using a picFrame rectangle of some size in the OpenPicture call,
> and then drawing the picture with a dstRect rectangle of a different size
> in the DrawPicture call.  QuickDraw will scale everything in the picture
> in such a way as to make the picFrame match the dstRect.

Better still - draw everything into an offscreen bitmap and copybits it
to the screen. That way you are in complete control of any scaling, etc...
and it isn't as slow :-( as PICTs.

+++
Mimir (aries@rhi.hi.is) - Aries, Inc.

casseres@apple.com (David Casseres) (06/02/90)

In article <1745@krafla.rhi.hi.is> aries@rhi.hi.is (Reynir Hugason) writes:
> Better still - draw everything into an offscreen bitmap and copybits it
> to the screen. That way you are in complete control of any scaling,
> etc... and it isn't as slow :-( as PICTs.

That works fine if you have enough space in memory for the bitmap, and if 
you are willing to have all scaling done at the bitmap level.  In general 
this results in some ugly-looking artifacts if the scaling ratio is not a 
"nice" one, as you can see by using MacPaint and stretching and squashing 
images on the screen.

David Casseres
     Exclaimer:  Hey!