On 6 Apr '08, at 1:40 PM, Lorenzo wrote:

But when I ask for its size with
   NSSize imageSize = [sourceImage size];
I don’t get the real pixel size (1680 x 1050), but I get (504 x 315)

The units of [NSImage size] are points, not pixels. If you read an NSImage from a file, it respects the DPI, if any, encoded in the file.

If you want the pixel size, you need to get the NSImageRepresentation that has the pixels you're interested in (remember, an NSImage can have multiple representations of different resolutions; both TIFF and icns support this) and ask it for its pixelsWide and pixelsHigh.

In this case I get a destination image with the
same size as the original (1680 x 1050), but the original image is drawn
therein in a smaller area (504 x 315) in the letf-bottom corner.

What size did you draw the source image at? If you want to scale it up to fill a larger pixmap, you need to use a larger source rectangle when you draw it.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to