1
votes

I'm trying to draw simple map in WPF. I need to draw shapes, text and images. It also should be possible to use mouse to move around and zoom in and out.

Right now, I have combination of Canvas + Geometry + Transforms to draw shapes, but I don't know how to add text and images.

I already tried various combination of Canvas/Grid and Layout/Render transform. Biggest problem is adding text and images, because transformations are in geometries.

1

1 Answers

0
votes

If i understand you right, you're currently putting Path objects (with transformed Geometries) into a Canvas. For adding text and images you could easily add TextBlock and Image objects to the same Canvas and apply your transformations to their RenderTransform property.

A completely different approach would be to use WPF low-level rendering, provided by the DrawingVisual class. You may start at WPF Graphics Rendering Overview.