I need to apply a custom shape (this, a .jpg) to any image I load into my application, using Windows Forms if possible (since my whole project is made in Winforms), but I guess I can use WPF if it’s needed.
So for example if I have a photo like this, the result should be like this (I made this with Photoshop for you to see), maybe even without the white borders if possible (please note that the image was resized and centered to fit the custom shape, and that’s how it should be).
I can’t figure out how to do this, but from what I’ve searched I suppose it has something to do with brushes (TextureBrush, ImageBrush, etc).
Regards.
2
Answers
Here is an example tuned for the image you linked to:
it seems to me that you want to apply a mask, you could do it with something like this (using /unsafe code):
this is very much inspired by Balazs Tihanyi answers on Draw image on top of another image with blending mode color