2013-04-25 81 views
0

我有以下代码并排横向合并两个图片的一面:与绘制的uImage到图形上下文奇怪的行为

 CGFloat firstWidth = ImageLeft.size.width; 
     CGFloat firstHeight = ImageLeft.size.height; 


     CGFloat secondWidth = ImageRight.size.width; 
     CGFloat secondHeight = ImageRight.size.height; 

     CGSize sizetoNewImage = CGSizeMake(firstWidth+secondWidth , firstHeight); // Here merging two images horizontally , 

     UIGraphicsBeginImageContext(sizetoNewImage); 

     [ImageLeft drawInRect : CGRectMake(0,0,firstWidth,firstHeight)]; 
     [ImageRight drawInRect:CGRectMake(firstWidth,0,secondWidth,secondHeight)];// Here merging two images horizontally , 

     backgroundImage = UIGraphicsGetImageFromCurrentImageContext(); 
     UIGraphicsEndImageContext(); 

的问题是,当我告诉和backgroundImage它模糊了所有文本。虽然,如果我显示单独的图像,用于加入一个图像 - 他们显示所有文本都很好。 我在那里失踪?

预先感谢

回答

2

another answer从使用视网膜图像时,使用以下方法来创建图像上下文。

UIGraphicsBeginImageContextWithOptions(size, NO, 0.0f); // 0.0 means [UIScreen mainScreen].scale 
+0

谢谢,这个伎俩! – Adviser2010 2013-04-29 07:28:55