I am developing at Xamarin and would like to draw a simple circle with the text βCIRCLEβ inside it and display this image in a UIImageView. The problem is that the circle and the text look very blurry. I read a little about subpixels, but I don't think this is my problem.
Here's a blurry image and code, hoping someone has some ideas :)
UIGraphics.BeginImageContext (new SizeF(150,150)); var context = UIGraphics.GetCurrentContext (); var content = "CIRCLE"; var font = UIFont.SystemFontOfSize (16); const float width = 150; const float height = 150; context.SetFillColorWithColor (UIColor.Red.CGColor); context.FillEllipseInRect (new RectangleF (0, 0, width, height)); var contentString = new NSString (content); var contentSize = contentString.StringSize (font); var rect = new RectangleF (0, ((height - contentSize.Height) / 2) + 0, width, contentSize.Height); context.SetFillColorWithColor (UIColor.White.CGColor); new NSString (content).DrawString (rect, font, UILineBreakMode.WordWrap, UITextAlignment.Center); var image = UIGraphics.GetImageFromCurrentImageContext (); imageView.Image = image;

Click ahead
source share