<?xml version="1.0" encoding="UTF-8"?><feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
  xml:base="http://sharpgeek.com/wp-atom.php"
  xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"  >
	<title type="text">SharpGeek</title>
	<subtitle type="text">A blog about iPhone and Unity 3D programming</subtitle>

	<updated>2016-01-08T23:32:18Z</updated>

	<link rel="alternate" type="text/html" href="http://sharpgeek.com" />
	<id>http://sharpgeek.com/feed/atom/</id>
	<link rel="self" type="application/atom+xml" href="http://sharpgeek.com/feed/atom/" />

	<generator uri="http://wordpress.com/">WordPress.com</generator>
<link rel="search" type="application/opensearchdescription+xml" href="http://sharpgeek.com/osd.xml" title="SharpGeek" />
<link rel="search" type="application/opensearchdescription+xml" href="https://wordpress.com/opensearch.xml" title="WordPress.com" />
	<link rel='hub' href='http://sharpgeek.com/?pushpress=hub' />
	<entry>
		<author>
			<name>randyedmonds</name>
						<uri>http://randyedmonds.wordpress.com/</uri>
					</author>
		<title type="html"><![CDATA[MKMapView UIGraphicsGetImageFromCurrentImageContext not working on retina display]]></title>
		<link rel="alternate" type="text/html" href="http://sharpgeek.com/2011/08/19/mkmapview-uigraphicsgetimagefromcurrentimagecontext-not-working-on-retina-display/" />
		<id>http://sharpgeek.com/?p=10</id>
		<updated>2011-08-19T19:09:34Z</updated>
		<published>2011-08-19T19:09:34Z</published>
		<category scheme="http://sharpgeek.com" term="Uncategorized" /><category scheme="http://sharpgeek.com" term="code" /><category scheme="http://sharpgeek.com" term="iOS" /><category scheme="http://sharpgeek.com" term="MKMapView" />		<summary type="html"><![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: [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=sharpgeek.com&#038;blog=26304264&#038;post=10&#038;subd=sharpgeek&#038;ref=&#038;feed=1" width="1" height="1" />]]></summary>
		<content type="html" xml:base="http://sharpgeek.com/2011/08/19/mkmapview-uigraphicsgetimagefromcurrentimagecontext-not-working-on-retina-display/"><![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> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=sharpgeek.com&#038;blog=26304264&#038;post=10&#038;subd=sharpgeek&#038;ref=&#038;feed=1" width="1" height="1" />]]></content>
			<link rel="replies" type="text/html" href="http://sharpgeek.com/2011/08/19/mkmapview-uigraphicsgetimagefromcurrentimagecontext-not-working-on-retina-display/#comments" thr:count="0"/>
		<link rel="replies" type="application/atom+xml" href="http://sharpgeek.com/2011/08/19/mkmapview-uigraphicsgetimagefromcurrentimagecontext-not-working-on-retina-display/feed/atom/" thr:count="0"/>
		<thr:total>0</thr:total>
	</entry>
	</feed>
