[plt-scheme] Re: region displayed after dc is scaled

From: zen1986 at gmail.com (zen1986 at gmail.com)
Date: Thu May 22 06:47:28 EDT 2008

Hi Matthew,
I used set-origin to navigate the enlarged picture.
That works for me, thanks.

On May 21, 9:43 pm, Matthew Flatt <mfl... at cs.utah.edu> wrote:
> At Wed, 21 May 2008 06:03:04 -0700 (PDT), "zen1... at gmail.com" wrote:
>
> > I am using Mred to build some graphics.
> > I encounter this problem:
> > after My dc is scaled up, the top left region is always displayed.
> > How can I make it show the center region?
>
> It sounds like you have a drawing in some fixed-sized region like this:
>
>   ----------
>   |  ****  |
>   | **  ** |
>   | **  ** |
>   |  ****  |
>   ----------
>
> and when you prefix the drawing with something like `(send dc set-scale
> 2 2)', then the drawing looks like
>
>   ----------
>   |        |
>   |    ****|***
>   |  ******|*****
>   |  ****  | ****
>   ---------- ****
>      ****    ****
>      ****    ****
>      ************
>        ********
>
> where the part outside the box is clipped.
>
> But you want
>
>     ********
>   *----------*
>   *|**    **|*
>   *|**    **|*
>   *|**    **|*
>   *|**    **|*
>   *----------*
>     ********
>
> ?
>
> In that case, you can adjust the drawing origin, in addition to the
> scale, by calling the `set-origin' method of the drawing context,
> something like
>
>  `(send dc set-origin -10 -10)'
>
> but the actual numbers will depend on the scale factor and the size of
> the drawn image.
>
> Matthew
>
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.