<?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/"
	>

<channel>
	<title>iPhoneGeek 爱疯极客 &#187; UIImage</title>
	<atom:link href="http://www.iphone-geek.cn/tag/uiimage/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iphone-geek.cn</link>
	<description>iPhone 新闻，编程，技巧与提示，代码，教程</description>
	<lastBuildDate>Sun, 25 Jul 2010 13:49:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>怎样从core graphics获取UIImage</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e6%80%8e%e6%a0%b7%e4%bb%8ecore-graphics%e8%8e%b7%e5%8f%96uiimage</link>
		<comments>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e6%80%8e%e6%a0%b7%e4%bb%8ecore-graphics%e8%8e%b7%e5%8f%96uiimage#comments</comments>
		<pubDate>Mon, 06 Jul 2009 07:37:25 +0000</pubDate>
		<dc:creator>bagusflyer</dc:creator>
				<category><![CDATA[图形图像]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[Core Graphics]]></category>
		<category><![CDATA[UIImage]]></category>
		<category><![CDATA[代码片段]]></category>

		<guid isPermaLink="false">http://iphonegeek.zuesitech.com/?p=160</guid>
		<description><![CDATA[从core graphics获取UIImage的方法：
&#160;
12345678910111213141516- &#40;void&#41;viewDidLoad 
&#123;
&#160; &#160; &#91;super viewDidLoad&#93;;

&#160; &#160; UIGraphicsBeginImageContext&#40;CGSizeMake&#40;20,20&#41;&#41;;
&#160; &#160; CGContextRef ctx = UIGraphicsGetCurrentContext&#40;&#41;;
&#160; &#160; CGContextBeginPath&#40;ctx&#41;;
&#160; &#160; CGContextAddArc&#40;ctx, 10, 10, 10, 0, 2*M_PI, 1&#41;;
&#160; &#160; CGContextSetRGBFillColor&#40;ctx, 1,0, 0, 1&#41;;
&#160; &#160; CGContextFillPath&#40;ctx&#41;;
&#160; &#160; UIImage *redBall = UIGraphicsGetImageFromCurrentImageContext&#40;&#41;;
&#160; &#160; UIGraphicsEndImageContext&#40;&#41;;
&#160; &#160; UIImageView *redBallView = &#91;&#91;UIImageView alloc&#93; initWithImage:redBall&#93;;
&#160; &#160; redBallView.center = CGPointMake&#40;160,330&#41;;
&#160; &#160; &#91;self.view addSubview:redBallView&#93;;
&#125;
]]></description>
			<content:encoded><![CDATA[<p>从core graphics获取UIImage的方法：</p>
<p>&nbsp;</p>
<div class="codecolorer-container objc mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidLoad <br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>super viewDidLoad<span style="color: #002200;">&#93;</span>;<br />
<br />
&nbsp; &nbsp; UIGraphicsBeginImageContext<span style="color: #002200;">&#40;</span>CGSizeMake<span style="color: #002200;">&#40;</span>20,20<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGContextRef ctx <span style="color: #002200;">=</span> UIGraphicsGetCurrentContext<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGContextBeginPath<span style="color: #002200;">&#40;</span>ctx<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGContextAddArc<span style="color: #002200;">&#40;</span>ctx, 10, 10, 10, 0, 2<span style="color: #002200;">*</span>M_PI, 1<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGContextSetRGBFillColor<span style="color: #002200;">&#40;</span>ctx, 1,0, 0, 1<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGContextFillPath<span style="color: #002200;">&#40;</span>ctx<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; UIImage <span style="color: #002200;">*</span>redBall <span style="color: #002200;">=</span> UIGraphicsGetImageFromCurrentImageContext<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; UIGraphicsEndImageContext<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; UIImageView <span style="color: #002200;">*</span>redBallView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImageView alloc<span style="color: #002200;">&#93;</span> initWithImage<span style="color: #002200;">:</span>redBall<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; redBallView.center <span style="color: #002200;">=</span> CGPointMake<span style="color: #002200;">&#40;</span>160,330<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>self.view addSubview<span style="color: #002200;">:</span>redBallView<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e6%80%8e%e6%a0%b7%e4%bb%8ecore-graphics%e8%8e%b7%e5%8f%96uiimage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
