ios 自定义UIView绘制时文字上下颠倒问题解决
2014-01-10 13:07
477 查看
- (void)drawRect:(CGRect)rect
{
[self showPage:m_currentPageIndex];
}
- (void)showPage:(int)pageIndex
{
CGContextRef cntxRef = UIGraphicsGetCurrentContext();
CGPDFPageRef page = CGPDFDocumentGetPage (m_docRef, pageIndex);// 2
// Quartz画图得坐标系统是以左下角为开始点,但iphone视图是以左上角为开始点
CGContextTranslateCTM(cntxRef, 0, self.bounds.size.height);
//转变坐标系
CGContextScaleCTM(cntxRef, 1.0, -1);
CGContextDrawPDFPage (cntxRef, page);// 3
}
{
[self showPage:m_currentPageIndex];
}
- (void)showPage:(int)pageIndex
{
CGContextRef cntxRef = UIGraphicsGetCurrentContext();
CGPDFPageRef page = CGPDFDocumentGetPage (m_docRef, pageIndex);// 2
// Quartz画图得坐标系统是以左下角为开始点,但iphone视图是以左上角为开始点
CGContextTranslateCTM(cntxRef, 0, self.bounds.size.height);
//转变坐标系
CGContextScaleCTM(cntxRef, 1.0, -1);
CGContextDrawPDFPage (cntxRef, page);// 3
}
相关文章推荐
- iOS开发与OpenGL ES相关问题整理(2)- 绘制图片上下颠倒
- iOS开发与OpenGL ES相关问题整理(2)- 绘制图片上下颠倒
- iOS 绘制图片上下颠倒
- iOS----自定义UIView,绘制一个UIView
- iOS开发图像处理--绘制图片上下颠倒
- 自定义气泡文字背景遇到的上下边距比较宽的问题
- iOS开发与OpenGL ES 绘制图片上下颠倒
- 新浪微博开发八(自定义标题按钮,解决图片在文字右边的问题)
- 使用CGContextDrawImage绘制图片上下颠倒解决方法
- IOS开发 Xcode7.3不能提示自定义类名问题解决办法
- iOS开发图像处理--绘制图片上下颠倒
- <iOS>解决自定义相机的打开时动画不一致问题
- [ iOS问题] Xcode7.3不能提示自定义类名问题解决办法
- iOS开发图像处理--绘制图片上下颠倒
- css ios H5页面web页面 上下滑动卡顿问题解决方案
- iOS 上下有黑边问题解决
- 解决IE8中select下拉列表文字上下不居中的问题
- 解决iOS 模拟器上下出现黑色区域的问题
- iOS - 自定义alertView,继承自UIView,可以添加子视图,标题图片+文字
- iOS开发图像处理--绘制图片上下颠倒 .