Many apologies if this is a duplicate. I am writing a number of BitmapImages onto a specific portion of a canvas like this (snippet). It works fine:
TreeFile = "pack://application:,,,/Images/" + TreeFile;
var image = new Image
{
Source = new BitmapImage(new Uri(TreeFile))
};
image.Width = 10;
image.Height = 10;
Canvas.SetLeft(image, x );
Canvas.SetTop(image, y );
MainCanvas.Children.Add(image);
What I want to do is to also copy image
to a WriteableBitmap BlankMap;
at the same time and in the same location (MainCanvas and the BlankMap are the same size). This is to create an 'undo'. Then, assuming the user wants to keep the new composite image copy BlankMap
to the final BitmapImage WorkingMap;
Lastly, I will need to save the now completed WorkingMap
to disk.
So my questions are:
- Is using WriteableBitmaps the correct way to go for this?
- How would I write
image
toBlankMap
? - How would I write
BlankMap
toWorkingMap
(though #2 and #3 are probably the same question/answer.
Thanks! And, again, apologies if this is some form of a duplicate question.