multible NSImages rotated in the same view
multible NSImages rotated in the same view
- Subject: multible NSImages rotated in the same view
- From: Brian Williams <email@hidden>
- Date: Fri, 15 Feb 2002 08:21:15 -0800 (PST)
Hi all,
Sorry but I am feeling stupid today. Can't seem to get
a grip on the whole drawing cooridnate system. The
docs haven't helped and the list archives aren't
producing much for me.
Question:
How can I rotate a NSImage multiple times in the same
NSView? This code does not work:
- (void)drawRect:(NSRect)rect {
NSRect sourceRect NSMakeRect(0,0,[img
size].width,[img size].height);
[[NSColor blueColor] set];
NSRectFill([self bounds]);
[img drawAtPoint:[self bounds].origin
fromRect:sourceRect operation:NSCompositeSourceOver
fraction:0.5];
[self rotateByAngle:45];
[img drawAtPoint:[self bounds].origin
fromRect:sourceRect operation:NSCompositeSourceOver
fraction:0.5];
[self rotateByAngle:-45];
}
One other question:
why does making the sourceRect bigger make the image
small on the screen? I guess I really don't understand
the coordinate system
Thanks for reading this and for any help
Brian
Got something to say? Say it better with Yahoo! Video Mail
http://mail.yahoo.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.