• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to affinely transform an NSView's content
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to affinely transform an NSView's content


  • Subject: Re: How to affinely transform an NSView's content
  • From: "John C. Randolph" <email@hidden>
  • Date: Sun, 6 May 2007 07:15:01 -0700


On Apr 20, 2007, at 5:50 AM, Ewan Delanoy wrote:

        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.

NSAffineTransform is overkill for what you're describing. See NSView's -setBoundsRotation: method.


-jcr


"This is not a book to be tossed aside lightly. Rather, it should be hurled with great force." -Dorothy Parker


_______________________________________________

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


  • Prev by Date: Re: Adding an event handler to an NSView subclass using categories
  • Next by Date: NSWindowController MyDocument not appearing
  • Previous by thread: Re: Leaks with Core-Data while fetching data
  • Next by thread: NSWindowController MyDocument not appearing
  • Index(es):
    • Date
    • Thread