The purpose of giving a picture watermark:
Tell someone about the source of the picture.
Prevent others from stealing pictures. Advertise.
Add a watermark It's finally generating a new picture.
The picture context is used to generate the picture. No need to customize view,
The view was previously customized because the context associated with the view was to be taken.
The context associated with view is automatically created by the system, so we do not need to create it ourselves manually,
But the picture context requires us to manually create it ourselves. We also need to manually shut down.
The idea of realizing the watermark effect:
Opens a picture context that is the same as the original picture.
Draw the original picture to the picture context first.
Then the watermark (text, logo) to be added to the picture context.
Finally, a picture is taken out of the context.
Close the picture context.
1. How do I open a picture context?
Size: Turn on how big the above
Opaque: Opacity
Scale: the zoom context.
Uigraphicsbeginimagecontextwithoptions (image.size, YES, 0);
2. How do I generate a picture from a picture context?
UIImage *newimage = Uigraphicsgetimagefromcurrentimagecontext ();
3. How do I close the context?
Uigraphicsendimagecontext ();
Love paper Tail-----quartz2d-Image Add watermark