そのため、私はCGBitmapContextを使用してソフトウェアブリッターをiOSに適合させています。データをビットマップに書き込んでから、CoreGraphics関数を使用してCGBitmapContextにテキストを書き込みます。ソフトウェアブリッターは左上の原点を使用し、CoreGraphics関数は左下の原点を使用します。そのため、(0、0)のブリッターを使用して画像を描画すると、左上隅に表示されます。(0、0)でCGを使用してテキストを描画すると、左下隅に表示され、反転されません。はい、座標の反転に関する他のすべての質問を読みました。結果のCG画像に対してそれを実行して、ビューに正しく表示します。おそらくコード例が役立つでしょう...
// This image is at the top left corner using the custom blitter.
screen->write(image, ark::Point(0, 0));
// This text is at the bottom left corner RIGHT SIDE UP
// cg context is a CGBitmapContext
CGContextShowTextAtPoint(
cgcontext,
0, 0,
str.c_str(),
str.length());
// Send final image to video output.
CGImageRef screenImage = CGBitmapContextCreateImage(cgcontext);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0, 480);
// Here I flip the whole image, so if I flip the text above, then
// it ends up upside down.
CGContextScaleCTM(context, 1, -1);
CGContextDrawImage(context,
CGRectMake(0, 0, 320, 480), screenImage);
CGContextRestoreGState(context);
CGImageRelease(screenImage);
座標系を組み合わせるにはどうすればよいですか?ULCオリジンを使用してテキストを右側を上にして描画するにはどうすればよいですか?