码迷,mamicode.com
首页 > 其他好文 > 详细

Chapter 19 Subclassing UITableViewCell

时间:2014-10-04 22:21:17      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:des   io   os   for   sp   c   on   cti   r   

Chapter 19 Subclassing UITableViewCell

 

1. iOS provides a convenient suite of functions to create offscreen contexts and produce images from them. To create an offscreen image context, you use the function UIGraphicsBeginImageContextWithOptions. This function accepts a CGSize structure that specifies the width and height of the image context, a scaling factor, and whether the image should be opaque. When this function is called, a new CGContextRef is created and becomes the current context.

To draw to a CGContextRef, you use Core Graphics, just as though you were implementing a drawRect: method for a UIView subclass. To get a UIImage from the context after it has been drawn, you call the function UIGraphicsGetImageFromCurrentImageContext.

Once you have produced an image from an image context, you must clean up the context with the function UIGraphicsEndImageContext.

Chapter 19 Subclassing UITableViewCell

标签:des   io   os   for   sp   c   on   cti   r   

原文地址:http://www.cnblogs.com/1oo1/p/4006251.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!