views:

114

answers:

0

hi

i am getting pixalated circle when zooming the view. i did draw a circle using the below code

CGContextSetAllowsAntialiasing(theContext, true);
CGContextSetShouldAntialias(theContext, true);  +
CGGradientRef myGradient;   
CGColorSpaceRef myColorspace;   
size_t num_locations = 2;   
CGFloat locations[2] = { 0.0, 0.0 };    
CGFloat components[8] = { 0.0, 0.0, 0.1, 0.9,  // Start color    
0.0, 0.0, 0.0, 0.4 }; // End color  

myColorspace = CGColorSpaceCreateDeviceRGB();   
myGradient = CGGradientCreateWithColorComponents (myColorspace, components,               
                  locations, num_locations);
CGPoint topCenter = CGPointMake(5, 5);
CGPoint midCenter = CGPointMake(5.0, 5.0);

CGContextDrawRadialGradient(theContext, myGradient, midCenter, 5, topCenter, 0, kCGGradientDrawsAfterEndLocation);

but i got corner brokend circle when i zoom it

anybody help me to fix the bug.