Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Problem with NSScrollView & NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with NSScrollView & NSImageView



I'm having a problem getting the scrolling in an NSScrollView that holds an NSImageView to scroll over the whole image. I've written a "scale" method that takes a makes imageRect vary with 1/scale and uses the display method:

[image drawInRect:drawingRect fromRect:imageRect operation:NSCompositeCopy fraction:1.0];

where drawingRect is the bounds of the visible area of the scroll view. The problem seems to be with the scrollView's documentView. It seems to me I should be able to scale the documentView by scale, no?

For example, if the image is 640 by 480 and the Scroll View has a visible area of 640 by 480 and I grab a 320 by 240 piece of the image (i.e., scale = 2) and display it in the Scroll View's visible area, shouldn't I make the Document View 1280 x 960? When I try this, the scrolling won't cover the whole image. What am I doing wrong?

Glenn Zelnike
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.