私は新しいプログラミングIOSアプリで、この問題に陥りました.Twitterに投稿したいアプリに2つの画像があります. + 画像 B 1 つの画像のみ。すでに画像の投稿とサイズ変更のプロセスが完了しています。ただし、画像A +画像Bを1つの画像にするのに助けが必要です。誰でも助けることができますか?ありがとうございました。

私は新しいプログラミングIOSアプリで、この問題に陥りました.Twitterに投稿したいアプリに2つの画像があります. + 画像 B 1 つの画像のみ。すでに画像の投稿とサイズ変更のプロセスが完了しています。ただし、画像A +画像Bを1つの画像にするのに助けが必要です。誰でも助けることができますか?ありがとうございました。

ここにあなたが使用できるいくつかのコードがあります...
仮定:
2 つの画像の寸法は同じです。画像のサイズが異なる場合は、自分で寸法をいじる必要があります。
UIImage *girl1 = INITIALIZE_HERE;
UIImage *girl2 = INITIALIZE_HERE;
// Get the size of your images (assumed to be the same)
CGSize size = [girl1 size];
// Create a graphic context that you can draw to. You can change the size of the
// graphics context (your 'canvas') by modifying the parameters inside the
// CGSizeMake function.
UIGraphicsBeginImageContextWithOptions(CGSizeMake(size.width*2, size.height), NO, 0);
// Draw the first image to your newly created graphic context
[girl1 drawAtPoint:CGPointMake(0,0)];
// Draw your second image to your graphic context
[girl2 drawAtPoint:CGPointMake(size.width,0)];
// Get the new image from the graphic context
UIImage *theOneImage = UIGraphicsGetImageFromCurrentImageContext();
// Get rid of the graphic context
UIGraphicsEndImageContext();
お役に立てれば!