Core Plot 1.0视网膜图像显示不正确

我刚刚完成了我的应用程序,并添加了一些伟大的事情与核心情节和他们的敬业的工作人员的帮助。 我的问题涉及使用视网膜显示图像。 我有一个注解是一个讲话泡泡的图片。 当我在模拟器中运行应用程序,它显示正常分辨率罚款,但是当我切换到视网膜,图像被裁剪。 看下面的图片。 我有一个名为Bubble的.png,我添加了另一个名为Bubble @ 2x的大小,是这个大小的两倍,我认为这是我需要做的。 这没有用。 所以我试图设置view.contentScale,看下面的代码。 但似乎没有任何工作。 任何人有什么想法,我忘了做什么? 再次感谢。

{ //first annotation NSValue *value = [self.myData objectAtIndex:index]; CGPoint point = [value CGPointValue]; NSString *number1 = [NSString stringWithFormat:@"(%.2f, ", point.x]; NSString *number2 = [NSString stringWithFormat:@"%.2f)", point.y]; NSNumber *x = [NSNumber numberWithFloat:point.x]; NSNumber *y = [NSNumber numberWithFloat:point.y]; NSArray *anchorPoint = [NSArray arrayWithObjects: x, y, nil]; NSString *final = [number1 stringByAppendingString:number2]; //second annotation UIImage *bubble = [UIImage imageNamed:@"Bubble.png"]; CPTImage *fillimage = [CPTImage imageWithCGImage:bubble.CGImage]; CPTBorderedLayer *imageLayer = [[CPTBorderedLayer alloc] init]; //imageLayer.contentsScale = [[UIScreen mainScreen] scale]; //tried this imageLayer.frame = CGRectMake(0, 0, 150, 80); //imageLayer.contentsScale = 2.0f; //and this imageLayer.fill = [CPTFill fillWithImage:fillimage]; CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:final style:annotationTextStyle]; _annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; _annotation.contentLayer = textLayer; _annotation.displacement = CGPointMake(90.0f, 5.0f); _annotation.rotation = M_PI * .03f; _picAnnotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; _picAnnotation.contentLayer = imageLayer; _picAnnotation.displacement = CGPointMake(75.0f, 5.0f); } 

在那个代码之后,我把两个注释都放在了一起。 正如你可以看到一个有效,另一个没有。 Retina显示屏

定期显示

如果您需要支持视网膜图像,您应该在创buildCPTImage时传递图像scale

 CPTImage *fillimage = [CPTImage imageWithCGImage:bubble.CGImage scale:bubble.scale];