{"id":3300,"date":"2011-04-15T14:40:35","date_gmt":"2011-04-15T19:40:35","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=3300"},"modified":"2011-04-15T14:40:37","modified_gmt":"2011-04-15T19:40:37","slug":"the-proper-care-and-feeding-of-nsimage","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2011\/04\/15\/the-proper-care-and-feeding-of-nsimage\/","title":{"rendered":"The Proper Care and Feeding of NSImage"},"content":{"rendered":"<p><a href=\"http:\/\/www.noodlesoft.com\/blog\/2011\/04\/15\/the-proper-care-and-feeding-of-nsimage\/\">Paul Kim<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.noodlesoft.com\/blog\/2011\/04\/15\/the-proper-care-and-feeding-of-nsimage\/\"><p>You could try turning off image interpolation in the destination graphics context but this isn&rsquo;t always possible or desirable. The better solution is just like before: use a custom image rep to do the drawing (select &ldquo;Drawn (custom image rep)&rdquo; from the pop-up). Since the drawing occurs at drawing time, instead of image creation time, it knows about the context it is drawing into and therefore can provide your drawing code with a context at the correct resolution. The crisp square on the right speaks for itself.\n<\/p><\/blockquote>\n<p>Fortunately, blocks make it easy to use custom image reps rather than <code>-lockFocus<\/code>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Paul Kim: You could try turning off image interpolation in the destination graphics context but this isn&rsquo;t always possible or desirable. The better solution is just like before: use a custom image rep to do the drawing (select &ldquo;Drawn (custom image rep)&rdquo; from the pop-up). Since the drawing occurs at drawing time, instead of image [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-3300","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/3300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=3300"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/3300\/revisions"}],"predecessor-version":[{"id":3301,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/3300\/revisions\/3301"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=3300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=3300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=3300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}