Hello all:
I'm experimenting with transforms and am seeing a strange result that I'm sure has a simple explanation (which I can't figure out).
I'm drawing a rectangle on an InkCanvas. The rectangle is centered around the point where a user clicks, as in:
Path RectangleShape = new Path(); Path.Data = new RectangleGeometry(new rect(UpperLeftPoint, LowerRightPoint));
This works, and when I click the canvas I see the rectangle. Now, I tried to uniformly scale the rectangle down a little about it's center:
ScaleTransform scaleTransform = new ScaleTransform(); scaleTransform.ScaleX = 0.55; scaleTransform.ScaleY = 0.55; RectangleShape.RenderTransform = scaleTransform; RectangleShape.RenderTransformOrigin = new Point(0.5, 0.5);The rectangle did appear smaller, but to my surprise it was also translated to the left and up. What accounts for this translation? Am I missing something? Thanks in advance.