• 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: Scaling a window background image quickly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scaling a window background image quickly


  • Subject: Re: Scaling a window background image quickly
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Sat, 5 Apr 2008 20:17:32 +0200


Le 5 avr. 08 à 19:53, Mike R. Manzano a écrit :
Hi everyone,

I have a window with a custom content view. The content view loads in a PDF image to be used as the window's background. I'd like the image to scale smoothly when the window is resized, so I set the source image to scale when resized (scalesWhenResized returns YES), and in my -drawRect: method, I'm setting the size of the image to the bounds of the view. This works exactly as I intended, except that it's really slow.

Is there a better way to do this that's much, much faster?

Thanks,

Mike


Do not manually resize your image and use -[NSImage drawInRect:fromRect:operation:fraction:] passing [self bounds] as first argument, and let the system resize the image as needed

You can also replace your custom view by a NSImageView.





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Scaling a window background image quickly
      • From: "Mike R. Manzano" <email@hidden>
References: 
 >Scaling a window background image quickly (From: "Mike R. Manzano" <email@hidden>)

  • Prev by Date: Re: NSOutlineView Problem
  • Next by Date: Re: Scaling a window background image quickly
  • Previous by thread: Scaling a window background image quickly
  • Next by thread: Re: Scaling a window background image quickly
  • Index(es):
    • Date
    • Thread