Assuming I have a BitmapSource (actually I have access to the raw pixels as well if necessary), how can I use a PathGeometry as a mask to cut out certain parts of the image?
01234567890123456789
0 --------------------
1 | + + |
2 | * |
3 | * ) |
4 | * |
5 | ( |
6 --------------------
Assuming I have a PathGeometry that describes a rectangle that goes from (0, 0) to (8, 3), I would like to be able to get one of the following two images:
01234567890123456789
0 --------------------
1 | + |
2 | * |
3 | |
4 | |
5 | |
6 --------------------
or
012345678
0 ---------
1 | + |
2 | *|
3 ---------