• 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: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?


  • Subject: Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?
  • From: Steve Christensen <email@hidden>
  • Date: Thu, 25 Aug 2016 06:20:37 -0700

> On Aug 24, 2016, at 8:37 PM, Jeff Szuhay <email@hidden> wrote:
>
>
>> On Aug 24, 2016, at 8:02 PM, Britt Durbrow <email@hidden> wrote:
>>
>>
>>> On Aug 24, 2016, at 12:59 PM, Jeff Szuhay <email@hidden> wrote:
>>>
>>> I draw my images (clocks) into a “reference” sized rectangle—for simplified position calculations—and then have CoreGraphics scale into the destination view rect.
>>
>> Don’t do that with bitmap scaling. It’s wasteful, and will look bad.
>>
>> Instead, create the bitmap at the correct size for it’s destination; and use the drawing matrix transform functions (scale, translate, rotate, etc) to set up your drawing environment.
>
>
> Okay, so when the user changes the clock size (it’s destination), then recreate the bitmap to the new size and redraw everything at the new scale?

Yep. That way you get the best-quality image since it's built to fit an explicit size.

And if parts of your display are cacheable, e.g., the clock background, then you can recreate them at that point. Keep an ivar with the size of the view when the image(s) were last cached and compare it against the view's current size.


_______________________________________________

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


References: 
 >Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect? (From: Jeff Szuhay <email@hidden>)
 >Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect? (From: David Duncan <email@hidden>)
 >Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect? (From: Jeff Szuhay <email@hidden>)
 >Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect? (From: Britt Durbrow <email@hidden>)
 >Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect? (From: Jeff Szuhay <email@hidden>)

  • Prev by Date: Re: Set the size of a sheet when it's first loaded
  • Next by Date: Re: runModalForWindow() doesn't re-activate former window upon return
  • Previous by thread: Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?
  • Next by thread: Does setFormatter() retain?
  • Index(es):
    • Date
    • Thread