Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
UIImageiOS で Objective-C を使用して s の基本的な操作について学習しています。128x128 の正方形の画像があるとします。画像の下半分を切り取り、上半分だけを 128x64 画像に保存するにはどうすればよいですか?
UIImage
UIImageのCGImageから小さなCGImageRefを取得します。
CGImageCreateWithImageInRect([image CGImage], someRect);
その画像を使用して、新しい画像を作成できます。
UIImage *nImage = [UIImage alloc] initWithCGImage:nImageRef];
上記を実行した後、おっとほとんど忘れました:
CGImageRelease(nImageRef);