• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problem with NSScrollView & NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Problem with NSScrollView & NSImageView
      • From: John Pannell <email@hidden>
  • Prev by Date: Cocoa newbie question
  • Next by Date: Re: Design Principles
  • Previous by thread: Re: Cocoa newbie question
  • Next by thread: Re: Problem with NSScrollView & NSImageView
  • Index(es):
    • Date
    • Thread