1

The documentation says that the first parameter is

"The rectangle in which to draw the image, specified in the current coordinate system"

What does it mean? Should I assume the size of that rectangle is in pixels or in points?

user732274
  • 1,069
  • 1
  • 12
  • 28

1 Answers1

0

It is in the coordinate system of the current context.

Quartz graphics contexts define a coordinate system with an initial size and apply additional transforms on it. So you have to know in which context you are drawing and what the current transformation matrix (CTM) is.

When drawing in NSViews the current context is set up in a way that you specify coordinates in point. This is identical to pixels on non-retina displays. The orientation of the y axis depends in the view's flippedness (-[NSView isFlipped]).

Nikolai Ruhe
  • 81,520
  • 17
  • 180
  • 200
  • I used to call this method to scale/crop images: it has always been extremely simple since I literally had nothing more to do than locking the focus on a new image, drawing and unlocking the focus. But now I'm trying to understand what would happen on retina display: is the size of the rectangle the destination size in pixels or points? – user732274 Nov 20 '12 at 20:18