In my application I draw a rectangle on an image view with my finger. The rectangle is created by using the drawRect
method and added on that image view.
Now my issue is that I have to store that image along with those rectangles in photolibrary. Like an image with rectangles having on imageview.
Can anyone help me in finding how to do this?
Here is my code for drawRect
method:
-(void)drawRect:(CGRect)rect
{
CGContextRef contextRef = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(contextRef, 5.0);
CGContextSetRGBStrokeColor(contextRef, 255.0, 1.0, 0.0, 1.0);
CGContextSetStrokeColorWithColor(contextRef,[UIColor redColor].CGColor);
// Draw the border along the view edge.
CGContextStrokeRect(contextRef, rect);
}