On Jan 14, 2016, at 13:26 , Andreas Höschler <ahoe...@smartsoft.de> wrote:
> 
> This should in a view with size {851, 899} get me a purple line starting 
> close to the lower left corner and ending close to the top right corner. But 
> that's not the case. The picture is drawn zoomed in!??

I’m not sure I understand completely. The image is drawn “zoomed in”, or the 
purple rectangle is drawn “zoomed in”, or both?

Note that the NSBitmapImageRep has dimensions in pixels, The rectangle’s 
coordinates are in points. You don’t show any code that’s drawing the image 
back to the screen (if that’s what you’re doing), but NSImage dimensions (the 
‘size’ property) is also in points, not pixels, even when the bitmap image rep 
is in pixels.

But if the purple rectangle is much too big, then it sounds like this is 
nothing to do with the image. Instead, your view is getting set to a size 
that’s much bigger than the window. One possible reason is that your window 
hierarchy is subject to autolayout, and your constraints are making the view 
bigger than the window.

Probably, your next step is to log all the coordinates and sizes, of windows, 
view, images and image reps that are used in your code (at the time drawing 
happens).

_______________________________________________

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

This email sent to arch...@mail-archive.com

Reply via email to