<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>SharpGeek</title>
	<atom:link href="http://sharpgeek.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sharpgeek.com</link>
	<description>A blog about iPhone and Unity 3D programming</description>
	<lastBuildDate>Fri, 19 Aug 2011 19:09:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sharpgeek.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>SharpGeek</title>
		<link>http://sharpgeek.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sharpgeek.com/osd.xml" title="SharpGeek" />
	<atom:link rel='hub' href='http://sharpgeek.com/?pushpress=hub'/>
		<item>
		<title>MKMapView UIGraphicsGetImageFromCurrentImageContext not working on retina display</title>
		<link>http://sharpgeek.com/2011/08/19/mkmapview-uigraphicsgetimagefromcurrentimagecontext-not-working-on-retina-display/</link>
		<comments>http://sharpgeek.com/2011/08/19/mkmapview-uigraphicsgetimagefromcurrentimagecontext-not-working-on-retina-display/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 19:09:34 +0000</pubDate>
		<dc:creator>randyedmonds</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[MKMapView]]></category>

		<guid isPermaLink="false">http://sharpgeek.com/?p=10</guid>
		<description><![CDATA[Trying to capture image of a MKMapview was working on the iOS simulator, my iPod Touch and iPad, but not on my iPhone 4. Turns out you have to use UIGraphicsBeginImageContextWithOptions&#8230; This doesn&#8217;t work on the retina display: (void)captureThumbnail:(id)theViewToCapture { UIGraphicsBeginImageContext(((UIView*)theViewToCapture).frame.size); [((UIView*)theViewToCapture).layer renderInContext:UIGraphicsGetCurrentContext()]; theImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } This does work on the retina display: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharpgeek.com&amp;blog=26304264&amp;post=10&amp;subd=sharpgeek&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Trying to capture image of a MKMapview was working on the iOS simulator, my iPod Touch and iPad, but not on my iPhone 4.</p>
<p>Turns out you have to use UIGraphicsBeginImageContextWithOptions&#8230;</p>
<p><strong>This doesn&#8217;t work on the retina display:</strong><br />
<code>(void)captureThumbnail:(id)theViewToCapture<br />
{<br />
UIGraphicsBeginImageContext(((UIView*)theViewToCapture).frame.size);<br />
[((UIView*)theViewToCapture).layer renderInContext:UIGraphicsGetCurrentContext()];<br />
theImage.image = UIGraphicsGetImageFromCurrentImageContext();<br />
UIGraphicsEndImageContext();<br />
}</code></p>
<p><strong>This does work on the retina display:</strong><br />
<code>(void)captureThumbnail:(id)theViewToCapture<br />
{<br />
UIGraphicsBeginImageContextWithOptions(((UIView*)theViewToCapture).frame.size, NO, 0.0);<br />
[((UIView*)theViewToCapture).layer renderInContext:UIGraphicsGetCurrentContext()];<br />
theImage.image = UIGraphicsGetImageFromCurrentImageContext();<br />
UIGraphicsEndImageContext();<br />
}</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sharpgeek.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sharpgeek.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sharpgeek.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sharpgeek.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sharpgeek.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sharpgeek.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sharpgeek.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sharpgeek.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sharpgeek.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sharpgeek.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sharpgeek.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sharpgeek.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sharpgeek.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sharpgeek.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sharpgeek.com&amp;blog=26304264&amp;post=10&amp;subd=sharpgeek&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sharpgeek.com/2011/08/19/mkmapview-uigraphicsgetimagefromcurrentimagecontext-not-working-on-retina-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/35bb9ea3f3ebf318ce8fcaae2a120bef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">randyedmonds</media:title>
		</media:content>
	</item>
	</channel>
</rss>
