2011-06-22 5 views
1

私は、署名画像とファックス画像のテキストを重ね合わせようとしています。 は、私がこれまで使用しています次のコードを持っている:UIImageにイメージとテキストをオーバーレイするにはどうすればいいですか?

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(); 

は、私は私の署名の一部として、いくつかのテキストを記述する必要があります。 Arial size 10.どうしたらいいですか?私は本当に混乱しています。 NSString(UIStringDrawing)

答えて

1

チェックアウト– drawAtPoint:withFont:、このようないくつかのコードは動作するはずです:

[@"My Signature" drawAtPoint:somePoint withFont:[UIFont fontWithName:@"Arial" size:10.0]]; 
関連する問題