4
내 코드는이 텍스트를 거꾸로 그립니다. 왜?iosc의 QuartzCore 묘사 문제
- (void)drawRect:(CGRect)rect {
// Drawing code.
CGContextRef myContext = UIGraphicsGetCurrentContext();
CGRect contextRect = self.bounds;
UIGraphicsPushContext(myContext);
CGContextSelectFont (myContext, // 3
"Courier",
24,
kCGEncodingMacRoman);
CGContextSetCharacterSpacing (myContext, 1); // 4
CGContextSetTextDrawingMode (myContext, kCGTextFillStroke); // 5
CGContextSetRGBFillColor (myContext, 0, 1, 0, 1.0); // 6
CGContextSetRGBStrokeColor (myContext, 1.0, 1.0, 1, 1); // 7
CGContextShowTextAtPoint (myContext, 100, 50, "Quartz 2D", 9);
}
: CGContextSetTextMatrix() –
bleh http://stackoverflow.com/questions/3440825/does-cgcontextsettextmatrix-work-for-offscreen-bitmaps –
왜 그래야 하나? 두 개의 CTM을 연결하여 작동합니다. 텍스트 그리기는 문제가되지 않았습니다. – GorillaPatch