0

画像に注釈を付ける必要があります。

おそらく、現時点では見ることができない簡単な解決策です。

おそらく TouchesBegan/TouchesMoved/TouchesEnded メソッド (これは私が試したものです) によって、現在 iPad に表示されている画像に UILabel または UITextView を導入し、作成した UILabel または UITextView にテキストを追加する必要があります。したがって、追加したテキストをその特定の画像に埋め込む必要があります。

何か案は?

4

1 に答える 1

1

したがって、カスタム ラベルを作成して移動し、ユーザーが移動を完了したら、次を使用します。

CGSize size = image.size;
UIGraphicsBeginImageContextWithOptions( size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();

// UIImages and CGImageRefs are flipped
CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, size.height);
CGContextConcatCTM(context, flipVertical);

CGContextDrawImage(context, rect, [image CGImage]); // draw the image

// CGContextConcatCTM(context, flipVertical); uncomment if the text is flipped - not sure now

[label.text drawAtPoint:label.frame.origin withFont:label.font];

UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
于 2012-08-28T11:45:03.760 に答える