14

Masking elements with Clipping in .NET MAUI

 2 years ago
source link: https://askxammy.com/masking-elements-with-clipping-in-net-maui/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
.Net MAUI

Masking elements with Clipping in .NET MAUI

Leomaris Reyes / 14 December, 2021

Howdy! 🙋‍♀️ Continuing with initiative, today is #DaySeven and we will be learning about Clipping in .NET MAUI!

La imagen tiene un atributo ALT vacío; su nombre de archivo es Screen-Shot-2021-12-14-at-1.21.49-PM.pngImagine if you could handle the cropping region of a design or view with greater precision … such as that we can mask an image in a circular shape 🧐🧐 It will be great, no?!! Well, I can tell you that with .NET MAUI we can already do it! 🤓

With Clipping, we can mask content based on Shapes (such as Ellipse, Rectangle …). This will help make our work easier, with less code and without using external resources to achieve it!


How can I do it?

It is super easy below I show you the structure and the elements that you must take into account.

La imagen tiene un atributo ALT vacío; su nombre de archivo es Clip_str.png

And now, let’s see in code!

<Image Source="circle.png"> <Image.Clip> <EllipseGeometry RadiusX="80" RadiusY="80" Center="80,80" /> </Image.Clip> </Image>

Let’s explore Shapes properties needed:

  • RadiusX & RadiusY: Represents the Radius that the Shape will take on both the X and Y axes, respectively.
  • Center:     Indicates the position / coordinates that the radius previously applied will take.

Spanish post:

References:

I hope this article has been super useful for you! ⭐️ Thanks for reading! 💚💕

Tagged .NetMaui

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK