ARTICLE

Image with ScrollViewer in WPF using VB.NET

Posted by Rohatash Kumar Articles | WPF using VB.NET January 17, 2011
In this article you will learn how to create an application in which a Image work with ScrollViewer. we take a image control and ScrollViewer control in WPF.
 
Reader Level:

In this article you will learn how to create an application in which a Image work with ScrollViewer. we take a image control and ScrollViewer control in WPF.

For example

Taking a image control and ScrollViewer control on the form from Toolbox.

The form looks like this.

1.gif

Figure 1.

XAML code

<Window x:Class="MainWindow"

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

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

    Title="MainWindow" Height="350" Width="525">

    <ScrollViewer

    x:Name="scrollViewImage"

    HorizontalScrollBarVisibility="Visible"

    VerticalScrollBarVisibility="Visible" >

        <Grid

      x:Name="gridImageContainer"

      Background="Gray"

      ShowGridLines="True">

            <Grid.ColumnDefinitions>

                <ColumnDefinition></ColumnDefinition>

            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>

                <RowDefinition></RowDefinition>

            </Grid.RowDefinitions>

            <Image

         Grid.Row="0" Grid.Column="0" Name="Image1" Source="/WpfApplication15;component/Images/flowers-image.jpg">

            </Image>

        </Grid>

    </ScrollViewer>

    </Window>

 

Now run the application and increase the ScrollViewer.


2.gif 

Figure 2.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor