I am stuck on how to obtain the proper coordinates from a rectangle drawn over a D3DImage that is being used as the background in a Canvas object.
I have a 1920 x 1080 image that gets put into a D3DImage and that is used as the background of a Canvas object. The Canvas object is contained in a Viewbox. The user can draw rectangles (using a DrawingVisual object) on the canvas to denote things. The ViewBox does a nice job of ensuring the rectangles resize properly if the user resizes the window.
What I am trying to understand is how to map the points of the rectangle, which I believe are based on the canvas and the D3DImage. A D3DImage scales linearly by default and is scaled in true pixels. I am guessing that if I have a Canvas size of 640 x 360, I have a 30% scaling of the D3DImage. If one corner of a rectangle is at 100, 100 I think that is relative to the Canvas. But where is that point on the D3DImage? Is that point 30, 30 on the Image using a 30% scaling?
Any thoughts?
Thanks,
Doug