Skip to content

Is there an example of drawing clipped text? #328

Answered by tocsoft
mshakurov asked this question in Q&A
Discussion options

You must be logged in to vote

your looking for the Clip processor. You use it by passing any polygon as the first argument and then what ever processing you want applied inside that polygon as the 2nd.

img.Mutate(i=>i.Clip(new RectangularPolygon(10, 10, 100, 100) , j =>j.DrawText(...)))

Here is the sample from out samples repo https://github.com/SixLabors/Samples/blob/main/ImageSharp/ApplyEffectInsideShape/Program.cs for this api.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mshakurov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants