Problem with NSScrollView & NSImageView
Problem with NSScrollView & NSImageView
- Subject: Problem with NSScrollView & NSImageView
- From: Glenn Zelniker <email@hidden>
- Date: Fri, 23 Jul 2004 18:06:27 -0400
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.