Imagesharp: How to create image with rounded corners?

Created on 27 Apr 2017  路  4Comments  路  Source: SixLabors/ImageSharp

Description

I would like to round corners on a jpg image and get png transparent in corners. Can you provide an example?

question

Most helpful comment

@agoretsky we now have an example of exactly how to do that https://github.com/JimBobSquarePants/ImageSharp/blob/master/samples/AvatarWithRoundedCorner/Program.cs its dependent of stuff in builds >= 1.0.0-alpha9-00148

All 4 comments

Should be possible with an ImageBrush. @tocsoft Wanna knock up an example?

P.s @agoretsky please use the Gitter channel for questions. This tracker is for issues, hence the template. Thanks!

@agoretsky we now have an example of exactly how to do that https://github.com/JimBobSquarePants/ImageSharp/blob/master/samples/AvatarWithRoundedCorner/Program.cs its dependent of stuff in builds >= 1.0.0-alpha9-00148

example location is now at https://github.com/SixLabors/Samples/blob/master/ImageSharp/AvatarWithRoundedCorner/Program.cs - e.g.

IPathCollection corners = BuildCorners(img.Width, img.Height, cornerRadius);

Using the latest NuGet version (1.0.0-beta0006) this example is not working. Any advice on this?

Forgot the get the drawing package....

Was this page helpful?
0 / 5 - 0 ratings