My problem is I have paths to draw cities and I want to put images inside these cities I cant put Image inside <Path> tags.
Why cant I write such code? any solution?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use a canvas or a custom panel with x,y placements and add images to the correct coordinates (same coordinates used by path).
You can query the path nodes to find their coordinates if you don’t know them.
Edit: Since your window size changes and coordinates “stretch” accordingly, you will need to implement a custom panel. – Inherit from Panel and override measure and arrange methods as in this example: http://www.wpftutorial.net/CustomLayoutPanel.html
Your custom panel should have X and Y attached dependency properties (like Canvas does) only that methods should use either relative coordinates (0 to 1) instead of (0 to width and 0 to height) or divide by original path width and height to normalize to coordinates.