Re: Rotating an image
Re: Rotating an image
- Subject: Re: Rotating an image
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 20 Aug 2001 06:05:00 -0700
On Monday, August 20, 2001, at 05:36 AM, Angela Brett wrote:
Hi,
I've been learning how to display images etc for a game. I'd earlier
skimmed over the documentation for NSAffineTransform, and assumed it
was able to transform an NSImage. Now I've decided I'd actually like to
rotate an image, but I've looked more closely at NSAffineTransform and
found that it can only be used on NSBezierPaths and various other
things.
So, is there a built-in way of rotating an image, or at least
displaying it rotated, without writing my own code for it or pre-making
all of the rotated versions of the image?
- (void)drawAtPoint:(NSPoint)point fromRect:(NSRect)srcRect
operation:(NSCompositingOperation)op fraction:(float)delta
Partially composites the srcRect portion of the image to the location
point in the current coordinate system, using the specified operation,
op. delta is a fraction between 0.0 and 1.0 that specifies how much of
the resulting composite will come from the NSImage. The composite is
positioned and oriented according to the current coordinate system. The
image is rotated and scaled as needed.
hope this helps,
-jcr
begin
(If this message looks like it has an attachment, your mail reader is
brain-dead.)