我正在使用一个名为 Quarkee 的应用程序将徽标从 SVG 转换为 Quartz 2d 代码,这是一种享受。唯一的问题是我似乎无法弄清楚如何调整结果大小。如果我设置 UIView 的框架,drawRect 的结果会在框架中保持巨大。我如何让它成为我正在设置的框架的大小?
下面是一个输出的例子。
有人可以帮忙吗?
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGColorSpaceRef colorspace_1 = CGColorSpaceCreateDeviceRGB();
CGFloat components_1[] = {0.9961,0.9961,0.9961, 1.0000};
CGColorRef color_1 = CGColorCreate(colorspace_1, components_1);
CGContextSetFillColorWithColor(context,color_1);
CGContextMoveToPoint(context, 0.4960,0.1090);
CGContextAddLineToPoint(context,662.9260,0.1090);
CGContextAddLineToPoint(context,662.9260,227.8780);
CGContextAddLineToPoint(context,0.4960,227.8780);
CGContextAddLineToPoint(context,0.4960,0.1090);
CGContextClosePath(context);
CGContextFillPath(context);