nsaffinetransform

NSAffineTransforms not being used?

I have a subclass of NSView, and in that I'm drawing an NSImage. I'm unsing NSAffineTransforms to rotate, translate and scale the image. Most of it works fine. However, sometimes, the transforms just don't seem to get activated. For example, when I resize the window, the rotate transform doesn't happen. When I zoom in on the image, ...

Drawing an image in a NSView

I have a simple Obj C program that, at the moment, lets you load an image, draws it up, and theoretically should let you zoom and rotate. I'm using NSAffineTranslations. I want the image to be locked to the upper left (As opposed to the PS/PDF standard of lower left), so I'm using isFlipped, and calling [afTrans scaleXBy:1.0 yBy:-1.0]; ...

Rotating an NSImage with or without NSAffineTransform

I've got an NSImage being drawn on a subclass of NSView. In a previous question, I was helped to draw it upright in the upper left corner. Now, I want to be able to rotate the image. I have a button that increments a rotation variable %4, and then I multiply this by -90 to find the rotation angle. I then use an NSAffineTransform to rotat...

how to rotate an nscell

I am making a subclass of the NSLevelIndicatorCell and I want to draw it vertically. This doesn't work, what am I doing wrong? - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView{ [[NSGraphicsContext currentContext] saveGraphicsState]; NSAffineTransform *transform = [NSAffineTransform transform]; [transform rotateByDegr...