Zoom Image on selected area using WPF

Posted by in WPF category on for Beginner level | Points: 250 | Views : 16465 red flag
Rating: 4 out of 5  
 1 vote(s)

In this article, we will discuss how to zoom a image using WPF Parameters.


Hi friends today we will discuss how to zoom a image using WPF Parameters.

  1. Once open the Visual Studio click on File Click on the Project .

  1. As you are seeing there are many application(s) from them Select WPF application
  2. At name rename it as per your requirement.

Adding new folder :

  1. Right click on the project click on Add from there click on New Folder
  2. Name the folder as per your requirement .

We need to add existing item . we need to add image in this folder . its very important area ensure that you’re
going to add image with read,write permissions

<ImageBrush ImageSource= ":D\Beautyfull-Birds-1.jpg"/>

Once image added into folder ensure that drag and drop at image source . 
Type the image path and ensure that path is correct .

Once the image is added in that path preview of that of form will look like above .

<Window x:Class="ImageZoomExample.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <ScrollViewer x:Name="scrollViewer"
        <Canvas Height="200" Name="mainCanvas" Width="400"
                <ImageBrush ImageSource="D:\Beautiful-Birds-1.jpg"/>
                    <ScaleTransform x:Name="scaleTransform"/>

  1. Click F5 and run the project the out put screen look like above .
  2. As your able to see a red color box area going to zoom and looks like below .


In this article we have seen how to zoom Image on selected area Using WPF.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Pardha Saradhi
Member Level:
Member Status: Member
Member Since: 3/19/2013 2:21:22 PM
Country: India


Login to vote for this post.

Comments or Responses

Posted by: Thomas128 on: 10/27/2014 | Points: 25
Hi Padha,I&#39;m learning about image processing lately and thanks for your great post for image zooming !

Posted by: Azalin on: 4/12/2016 | Points: 25
So where is the .cs file?

Login to post response

Comment using Facebook(Author doesn't get notification)