-1

Instead of making various draw and bitmap blit calls to a canvas, how would I do it to a backscreen bitmap? The bitmap would be exactly the same size as the canvas and I want to draw and blit to the exact same coordinates.

So, this is a mapmaking program. Below is a screen capture of a series of PNGs (representing trees) that are added as children to the canvas:

enter image description here

Not only are they added to the canvas I also want to copy all of them to a backscreen (presumably a bitmap). This will be used for an undo function. Other various drawing calls (like swamp, roads, etc.) will also be copied to the backscreen and eventually to another bitmap and, eventually, saved to disk as the finished map.

Community
  • 1
  • 1
zetar
  • 1,225
  • 2
  • 20
  • 45

1 Answers1

0

Not really sure what you mean, but a fixed background for a canvas could be achieved in wpf like this. You could also feed the ImageBrush from Code via binding.

<Canvas x:Name="LayoutRoot" Margin="485,24,0,0" HorizontalAlignment="Left" Width="800" Height="600" VerticalAlignment="Top">
                    <Canvas.Background>
                      <ImageBrush ImageSource="../yourBackgroundImage.jpg" Stretch="None" />
                  </Canvas.Background>
              </Canvas>

Hope that helps. If I did not understand your question correctly please clarify and I am happy to revisit.

silverfighter
  • 6,762
  • 10
  • 46
  • 73