No matter what I do, I can't seem to figure out why my images keep coming out fuzzy on iOS displays.
It doesn't matter whether it's one I created in an image editor or drawing code, but I figured that code would make the issue much easier to parse. I know that if the line is 1 pixel wide, it'll appear fuzzy, but I tried multiple line width sizes with similar results. What can I do to make sure my graphics look sharp?
UIGraphicsBeginImageContext(CGSizeMake(1000, 1000));
UIBezierPath *bezier = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 1000, 1000)];
[[UIColor greenColor]set];
[bezier fill];
[[UIColor blackColor]set];
bezier = [UIBezierPath bezierPath];
[bezier setLineWidth:1.5]; //I tried .5, 1, 1.5, & 2 with similar results
[bezier moveToPoint:CGPointMake(450, 500)];
[bezier addLineToPoint:CGPointMake(500, 400)];
[bezier addLineToPoint:CGPointMake(550, 500)];
[bezier closePath];
[bezier stroke];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…