2011-06-22 36 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大小10.我該怎麼做?我感到非常困惑。結帳– drawAtPoint:withFont:NSString(UIStringDrawing)

回答

1

,像這樣的代碼應該工作:

[@"My Signature" drawAtPoint:somePoint withFont:[UIFont fontWithName:@"Arial" size:10.0]]; 
相關問題