"WIN10" win2d--layers

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.