First look at the effect:
The effect is still not wrong.
This feature is a bit like the layers and masks of PS.
Simply add a layer:
Private void DRAW_MB (canvascontrol sender, Canvasdrawingsession drawingsession) { draw_normal (sender, drawingsession); using (Drawingsession.createlayer (1)) { Drawingsession.fillrectangle ( 0 0, Oriimage_. Sizeinpixels.width, Oriimage_. Sizeinpixels.height, Color.FromArgb (255255255));} }
Note: Be sure to use using, or it will be wrong!!!!
Second effect, first draw a vague background, and then add a circle on the OK, circle using the picture to fill, you can display a clear circular image ~~~~~~
Private voidDRAW_MB2 (canvascontrol sender, Canvasdrawingsession drawingsession) { Microsoft.Graphics.Canvas.Effects.GaussianBlurEffect Gaussianeffect=NewMicrosoft.Graphics.Canvas.Effects.GaussianBlurEffect (); Gaussianeffect.bluramount=Ten; Gaussianeffect.source=Oriimage_; Drawingsession.drawimage (Gaussianeffect); floatwidth =Oriimage_. Sizeinpixels.width; floatHeight =Oriimage_. Sizeinpixels.height; using(Drawingsession.createlayer (1) ) {Microsoft.Graphics.Canvas.Brushes.CanvasImageBrush br=NewMicrosoft.Graphics.Canvas.Brushes.CanvasImageBrush (sender); Br. Image=Oriimage_; Drawingsession.fillcircle (NewSystem.Numerics.Vector2 (Width/2, Height/2- -), -, BR); }}
The third effect, is also simple, the second effect has come out, the third effect is simple to copy paste that simple:
Private voidDraw_mosaic (canvascontrol sender, Canvasdrawingsession drawingsession) {draw_normal (sender, drawingsession); floatwidth =Oriimage_. Sizeinpixels.width; floatHeight =Oriimage_. Sizeinpixels.height; using(Drawingsession.createlayer (1f)) {Microsoft.Graphics.Canvas.Effects.GaussianBlurEffect Gaussianeffect =NewMicrosoft.Graphics.Canvas.Effects.GaussianBlurEffect (); Gaussianeffect.bluramount=5; Gaussianeffect.source=Oriimage_; Microsoft.Graphics.Canvas.Brushes.CanvasImageBrush BR=NewMicrosoft.Graphics.Canvas.Brushes.CanvasImageBrush (sender); Br. Image=Gaussianeffect; Br. Sourcerectangle=NewRect (0,0, width, height); Drawingsession.fillcircle (NewSystem.Numerics.Vector2 (Width/2, Height/2- -), -, BR); }}
PS: We want to use the soft "micro-oxford" facial knowledge technology to move the human face ... But the library needs to be connected, and without the wall, the net speed is not very good, so I gave up, using a fixed set of coordinates.
"WIN10" win2d--layers