开发者

How do I overlay an image and some text onto a UIImage?

I am trying to overlay a signature image along with some text on to a fax image. I have the following code that I am using so far:

CGRect faxImageRect = CGRectZero;
CGRect signatureRect = CGRectZero; //need to add a logo and some text here
//faxImage is a fax UIImage
//signature is a Logo UIImage

faxImageRect.size = faxImage.size;
signatureRect.size = signature.size;

// Adjust the signature's location within the fax image
signatureRect.origin = desirableLocation;

UIGraphicsBeginImageContext(faxImage.size);
[faxImage drawInRect:faxImageRect];
[signature drawInRect:signatureRect];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

I need to开发者_JS百科 write some text as part of my signature. Arial size 10. How do I do that? I am getting really confused.


Checkout – drawAtPoint:withFont: of NSString(UIStringDrawing), some code like this should work:

[@"My Signature" drawAtPoint:somePoint withFont:[UIFont fontWithName:@"Arial" size:10.0]];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜