Skip to content

Write/Read Masks #67

Answered by tocsoft
Tylertron1998 asked this question in Q&A
Jul 8, 2020 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

This isn't directly possible in our current API, however you could adapt the techniques from one of our samples (linked below) where you can make use of the ImageBrush to fill a shape of your choosing with the image/effect you want to apply.

Process is roughly;

  1. Create an IPath that represents your desired region.
  2. Make sure you have 2 image instances, src(buffer you want draw) and destination(buffer you want to draw to) (clone destination if you are just apply an effect and not drawing a 2nd image).
  3. Apply any effects etc to src as required.
  4. Crop down src so it fits the IPath.Bounds of your region.
  5. Fill your IPath using an ImageBrush taking your now cropped src in its constructor.
  6. ...
  7. Profit.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Tylertron1998
Comment options

Comment options

You must be logged in to vote
2 replies
@Tylertron1998
Comment options

@antonfirsov
Comment options

Answer selected by Tylertron1998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants