ACEDrawingView
ACEDrawingView copied to clipboard
how to add the background image ?
thanks.
This is a transparent view. You can add it on the top of an imageview with your background image
but i can't export to an UIImage with the background image or background color...
when i add the UIImageView to the ACEDrawingView, then i can't draw anything on the UIImageView .
ah, ok. So you have to blend the images.. For example
- (UIImage *)blendImage
{
UIImage *bottomImage = <your image>
UIImage *image = self.drawView.image;
UIGraphicsBeginImageContext( bottomImage.size );
CGRect imageFrame = CGRectMake(0.0f, 0.0f, bottomImage.size.width, bottomImage.size.height);
// Use existing opacity as is
[bottomImage drawInRect:imageFrame];
// Apply supplied opacity
[image drawInRect:imageFrame blendMode:kCGBlendModeNormal alpha:0.8];
UIImage *blendImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return blendImage;
}
thank u very mush...
@acerbetti When I use the method above, it works perfectly. However, if I then draw on the image, and hit the 'Undo' button, the blendImage
is cleared from the view. Is there a way to prevent this?
In other words, if the view counts the number of "drawn points" to manage the undo sequence, is there a way to reset the undo counter to zero (so that blending the images cannot be undone)? I'm trying to do basically the same thing with my method here: https://github.com/acerbetti/ACEDrawingView/issues/2#issuecomment-30702919, which also keeps the @2x image nice and sharp.
I want to use eraser to erase with background image how to use eraser to erase blendImage?
This sample is not good
I have made some changes for drawing on image. Please have a look here
Can you tell me how I can mask the canvas with an image with transparent areas?
I only want to be able to paint in the non transparent areas?
Or vice versa.
Many thanks.