ZoomContentControl

Navigation for WPF Forum

Posted 14 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 14 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 14 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 14 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 14 years ago by John Howe
Avatar
Thnaks for that, exactly what I was looking for.
The latest build of this product (v24.1.2) was released 3 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.