2
Answers

wpf zoom in and out of image

steven balderrama

steven balderrama

16y
14.4k
1

Hello,

Just wondering, how do you be able to zoom in and out of an imageviewer, for example, i want the user to be able to create an rectangular shape around the part of the image to zoom in and zoom back out, how can this be done?

Thank you

Answers (2)
0
anwar mohamed

anwar mohamed

NA 3 0 15y
Hi,

WPF:  I've a Image control inside a ScrollViewer and TIFF file set as its source. Image displayed with black overlay for some height values (in range of 40% to 60% of image's actual height).  This need to be resolved somehow. Only for some height range this problem occurs and when changed to other height it works normal.

Please note: 
1. The image has to be 600 DPI Resolution. 
2. Image Height="3510"  will reproduces the issue.
<
Image Source="htl.tif" Height="3510" Stretch="Uniform" StretchDirection="Both"/>

This is my test code as follows:
XAML

<Window x:Class="WpfApplication1.ScrollViewImage"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="ScrollViewImage" Height="300" Width="300">

    <Grid>

        <ScrollViewer Margin="5" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible">

            <Image Source="htl.tif" Height="3510" Stretch="Uniform" StretchDirection="Both"/>

        </ScrollViewer>

    </Grid>
</Window>


Regards,
Anwar
0
Bechir Bejaoui

Bechir Bejaoui

NA 20.1k 5.3m 16y

Take a look on my article
http://www.c-sharpcorner.com/UploadFile/yougerthen/408222008125400PM/4.aspx