[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please help with image rotation and scaling.
From: |
Alexander Malmberg |
Subject: |
Re: Please help with image rotation and scaling. |
Date: |
Mon, 19 May 2003 18:32:36 +0200 |
Tima Vaisburd wrote:
>
> Hello everybody,
>
> I'm learning Objective C and gnustep.
>
> I could not figure out how can I rotate an image in gnustep.
>
> As far as I can get, Apple documentation suggects using
> NSAffineTransform and -drawAtPoint: fromRect: operation: fraction
> inside -drawRect method of the view, like this:
In OpenStep, the NSImage methods do not handle any non-identity
transformations since they work by drawing to off-screen windows and
compositing from them. To draw a rotated image, get a non-cached image
representation for it (probably the only one) and use [NSImageRep
-drawInRect:].
[snip]
> [_image lockFocus];
...
> [_image unlockFocus];
Note that these mean that you're drawing _to_ the image, which probably
isn't what you want.
[snip]
> Also, what is the correct way to scale the image?
Scale the ctm ([drawXform scaleXBy: yBy:]), or pass in a suitable rect
to -drawInRect:.
- Alexander Malmberg
- Please help with image rotation and scaling., (continued)
- Please help with image rotation and scaling., Tima Vaisburd, 2003/05/18
- Re: Please help with image rotation and scaling., Pete French, 2003/05/19
- Re: Please help with image rotation and scaling., Alexander Malmberg, 2003/05/19
- Re: Please help with image rotation and scaling., Pete French, 2003/05/19
- Re: Please help with image rotation and scaling., Alexander Malmberg, 2003/05/19
- Re: Please help with image rotation and scaling., Pete French, 2003/05/20
- Re: Please help with image rotation and scaling., Alexander Malmberg, 2003/05/20
- Re: Please help with image rotation and scaling., Jeff Teunissen, 2003/05/19
- Re: Please help with image rotation and scaling., Pete French, 2003/05/19
- Re: Please help with image rotation and scaling., Alexander Malmberg, 2003/05/20
Re: Please help with image rotation and scaling.,
Alexander Malmberg <=
Re: Please help with image rotation and scaling., Tima Vaisburd, 2003/05/20
Re: ANNOUNCE GWorkspace 0.5.1, Enrico Sersale, 2003/05/21
Re: ANNOUNCE GWorkspace 0.5.1, eh666, 2003/05/18