bir hat üzerinde ok Ben yerleri ile çalışmak için rota-beni çerçevesini kullanıyorum. Bu kodda iki işaretçi (nokta) arasındaki yol bir çizgi olarak çizilecektir.Çizim üçgen/CGContext
Sorum:
Teşekkür
- (void)drawInContext:(CGContextRef)theContext
{
renderedScale = [contents metersPerPixel];
float scale = 1.0f/[contents metersPerPixel];
float scaledLineWidth = lineWidth;
if(!scaleLineWidth) {
scaledLineWidth *= renderedScale;
}
//NSLog(@"line width = %f, content scale = %f", scaledLineWidth, renderedScale);
CGContextScaleCTM(theContext, scale, scale);
CGContextBeginPath(theContext);
CGContextAddPath(theContext, path);
CGContextSetLineWidth(theContext, scaledLineWidth);
CGContextSetStrokeColorWithColor(theContext, [lineColor CGColor]);
CGContextSetFillColorWithColor(theContext, [fillColor CGColor]);
// according to Apple's documentation, DrawPath closes the path if it's a filled style, so a call to ClosePath isn't necessary
CGContextDrawPath(theContext, drawingMode);
}
Ben http://www.codeguru.com/cpp/gm/gdi/article.php/c3683 tarafından bir süre önce var neyse cevaplar Selamlamak – Pete
Pete için thansk, bu senin için çok iyi olabilir Yine de kabul edilen bir cevabı işaretleyin veya cevabınızı bir cevap olarak gönderin ve sonra bunu kabul edin. –
@Pete neden doğru cevabı işaretlemediniz (Friedhelm'in)? – yas375