• 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
Rotating an image in an NSImageView subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rotating an image in an NSImageView subclass


  • Subject: Rotating an image in an NSImageView subclass
  • From: Chris Garaffa <email@hidden>
  • Date: Fri, 11 Mar 2005 12:53:34 -0500

Title: Rotating an image in an NSImageView subclass
I’m trying to rotate the image in an NSImageView and running into trouble. So far, I’ve subclassed NSImageView and implemented the following:

@implementation TLRotatingImageView

- (void) drawRect: (NSRect) rect
{
    [super drawRect: rect];
    [[NSGraphicsContext currentContext] saveGraphicsState];
    NSAffineTransform *transform = [NSAffineTransform transform];
    [transform rotateByDegrees: 180.0];
    [transform concat];
    [[NSGraphicsContext currentContext] restoreGraphicsState];
    [self setNeedsDisplay: YES];
}

Based on the second example at <http://www.cocoadev.com/index.pl?RotateAndTranslateADrawing>.
The image is displayed, but not rotated. From my understanding of the NSAffineTransform documentation, concat should do this for me. What am I doing wrong?

Thanks

 

Chris Garaffa
Technician
TracyLocke
P 203.857.7506
F 203.762.2229

tracylocke.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Rotating an image in an NSImageView subclass
      • From: "John C. Randolph" <email@hidden>
    • Re: Rotating an image in an NSImageView subclass
      • From: daniel <email@hidden>
  • Prev by Date: Re: Inter-class Dependent Keys
  • Next by Date: Re: Cocoa from C++ (dont want to mix it)
  • Previous by thread: Some questions about NSZone
  • Next by thread: Re: Rotating an image in an NSImageView subclass
  • Index(es):
    • Date
    • Thread