• 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
Re: Centering an NSImageView in NSScrollView (again)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Centering an NSImageView in NSScrollView (again)


  • Subject: Re: Centering an NSImageView in NSScrollView (again)
  • From: Timothy Larkin <email@hidden>
  • Date: Sat, 12 Oct 2002 13:55:38 -0400

I worked on this problem for some time without coming up with a good solution for centering the image view in the scroll view.

But there's another approach which amounts to almost the same thing, and is pretty easy. Let the image view fill the content view in the usual way, without worrying about centering. Then override image view's drawRect: to draw its image centered in the view.

The centering of the image drawing can be done by computing an appropriate transform and then sending the image a drawInRect: message.

I am happy to share some code.
--
Timothy Larkin
Abstract Tools
Caroline, NY
_______________________________________________
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.

References: 
 >Re: Centering an NSImageView in NSScrollView (again) (From: Brock Brandenberg <email@hidden>)

  • Prev by Date: Re: App crashes on thread exit
  • Next by Date: Re: ColoredRowTableView
  • Previous by thread: Re: Centering an NSImageView in NSScrollView (again)
  • Next by thread: Re: Centering an NSImageView in NSScrollView (again)
  • Index(es):
    • Date
    • Thread