I want to Save Drawing lines permanently and load Drawing lines saved from Project resource...!
Now i am get x and y position on touch move event.i want to save the x and y position in local resource on a project,But i am not experience in ios for no idea...!
And Load Saved x and y position from project local resource saved file..!
I want to Save Drawing lines Below like this:
Please any one Help me with Greatly appreciated...!
Thanks...!
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if(!mouseSwiped) {
CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeClear);
UIGraphicsBeginImageContext(ivBack.frame.size);
[drawImage.image drawInRect:CGRectMake(0,0, self.ivBack.frame.size.width,self.ivBack.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), line);
CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(), [pickColor CGColor]);
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
CGContextFlush(UIGraphicsGetCurrentContext());
NSData *dataImage=UIImagePNGRepresentation(UIGraphicsGetImageFromCurrentImageContext());
[dataImage writeToFile:[self SavedImage:(@"1.png")] atomically:YES];
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
}
that will defenatly solve ur question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With