How to affinely transform an NSView's content
How to affinely transform an NSView's content
- Subject: How to affinely transform an NSView's content
- From: "Ewan Delanoy" <email@hidden>
- Date: Fri, 20 Apr 2007 14:50:54 +0200 (CEST)
- Importance: Normal
Hello all,
I have trouble connecting the different parts of the documentation
that deal with drawing rotated/translated/resized images. I think
NSAffineTransform
is the tool I need. The "Cocoa Drawing Guide: Using Transforms in
Your Code" section provides code snippets, but
1) It is not clear in which method those snippets must be put
( drawRect: , initWithFrame: ?)
2) Some snippets contain the metaphorical instruction
[item draw];
When "item" is the contents of a rect in an NSView, I don't
see what real-life instruction should replace it.
My aim is the following : To create a subclass RotatedView
of NSView that has a constructor method
-(id) initWithView: (NSView*) originalView
It is intended that the contents of subrectangle "rect1" of "originalView"
should be re-drawed in the RotatedView instance,
with a rotation of alpha degrees and compression factors cWidth,
cHeight, starting from point newOrigin. The RotatedView instance is
used later for printing.
Can anyone help me out on this ? TIA,
Ewan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden