Re: Rotating NSImage?
Re: Rotating NSImage?
- Subject: Re: Rotating NSImage?
- From: Matthew Formica <email@hidden>
- Date: Thu, 07 Jun 2001 17:10:33 -0700
-compositeToPoint:operation: ignores the rotation. For historical reasons,
this API can't be fixed, so you should use the new equivalent -drawAtPoint:
methods instead if you care about scale/rotation.
Matthew Formica
Apple DTS Engineer - Dev Tools and Cocoa
email@hidden
on 6/7/01 11:37 AM, Clyde McQueen at email@hidden remarked:
>
Should I expect NSImage objects to rotate when I rotate the enclosing
>
view? I've tried two ways:
>
>
1. An NSImageView set up in IB.
>
2. A custom view with:
>
>
- (void)drawRect:(NSRect)aRect
>
{
>
NSRect bounds = [self bounds];
>
NSImage *image = [[[NSImage alloc]
>
initByReferencingFile:PICTURE_PATH] autorelease];
>
NSPoint p;
>
>
p.x = bounds.origin.x + bounds.size.width / 2;
>
p.y = bounds.origin.y + bounds.size.height / 2;
>
>
[image compositeToPoint:p operation:NSCompositeCopy];
>
>
// ... and some NSBezierPaths so I can see the rotation...
>
}
>
>
In all cases the images show up just fine, but they appear to ignore the
>
rotation. What did I forget to do, or is this a limitation of NSImage?
>
>
/Clyde
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev