ZoomContentControl

Navigation for WPF Forum

Posted 9 years ago by John Howe
Avatar
Hi Guys,

I can see the TranslatePointToContent member, what I need is the reverse, in other words pass a point on the image and get a point relative to the element back.

Regards

John

Comments (4)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi John,

We've added the TranslatePointFromContent method to the ZoomContentControl for the next maintenance release.


Actipro Software Support

Posted 9 years ago by John Howe
Avatar
Hi Guys,

Thanks for that.

Any idea how long before the next release, I'm keen to make progress with a project we are working on.

Regards

John
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi John,

We are hoping to get the next release out in the next 2 to 3 weeks. In the interim, you could perform the same operation using the following code:
public Point TranslatePointFromContent(ZoomContentControl zoomContentControl, Point point) {
    if (zoomContentControl != null) {
        ZoomDecorator zoomDecorator = VisualTreeHelperExtended.GetFirstDescendant(zoomContentControl, typeof(ZoomDecorator)) as ZoomDecorator;
        if (zoomDecorator != null) {
            if (zoomDecorator.Child != null)
                return zoomDecorator.Child.TranslatePoint(point, zoomContentControl);
            return zoomDecorator.TranslatePoint(point, zoomContentControl);
        }
    }
    return point;
}


Actipro Software Support

Posted 9 years ago by John Howe
Avatar
Thnaks for that, exactly what I was looking for.
The latest build of this product (v2019.1 build 0683) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.