ZoomContentControl Overlay ScaleTransform

Navigation for WPF Forum

Posted 8 years ago by Luke G.
Version: 11.1.0542
Avatar
Hi,

I currently have a custom user control for drawing lines as an overlay to a ZoomContentControl which is ued to shows a image.
Drawing and everthing works fine, besides the zooming to some point.
I had to use ScaleTransform on my control to match the zoom level. But unfortunately the rendering is for some zoomlevels is incomplete. It just renders the half of my control.

Here is simplified code snipped.
<navigation:ZoomContentControl
    x:Name="ZoomBox"
    IsViewControlPaneVisible="False"
    MinZoomLevel="0.1"
    MaxZoomLevel="10.0"
    ZoomStep="0.1">
    <navigation:ZoomContentControl.Overlays>
        <local:ObjectDrawingControl Height="{Binding BitmapSource.Height, Mode=OneWay}"
                                    Width="{Binding BitmapSource.Width, Mode=OneWay}">
            <local:ObjectDrawingControl.RenderTransform>
                <ScaleTransform ScaleX="{Binding ElementName=ZoomBox, Path=ZoomLevel}"
                                ScaleY="{Binding ElementName=ZoomBox, Path=ZoomLevel}" />
            </local:ObjectDrawingControl.RenderTransform>
        </local:ObjectDrawingControl>
    </navigation:ZoomContentControl.Overlays>
    <Image Source="{Binding BitmapSource, Mode=OneWay}" />
</navigation:ZoomContentControl>
Thanks in advance.

Kind regards

Luke G.

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Luke,

I suspect your control is being clipped, by either the Clip/ClipToBounds property, or the GetLayoutClip virtual method. For the latter, you can override GetLayoutClip and return null to effectively disable it.

If that doesn't help please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.


Actipro Software Support

Posted 8 years ago by Luke G.
Avatar
Hi,

I solved my problem when using LayoutTransform instead of RenderTransform.

Best regards

Luke G.
The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.