Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

zoom in zoom out RSS

16 replies

Last post Apr 13, 2011 11:22 AM by anild05

(0)
  • venu1

    venu1

    Member

    2 Points

    2 Posts

    zoom in zoom out

    Oct 22, 2007 12:26 PM | LINK

    can some body help me with the source code to have functionality of zoom in and zoom out for a page turn application using silverlight1.0. Thank you very much

    Silverlight SilverlightDeveloper zoom

  • swildermuth

    swildermuth

    Star

    8438 Points

    1547 Posts

    Re: zoom in zoom out

    Oct 23, 2007 06:35 AM | LINK

    I don't have specific code, but generally you just want to use a ScaleTransform (in the RenderTransform) and tie that to whatever control mechiism you're using.

    Shawn Wildermuth
    MVP, Speaker and Author

    Web Workshop (HTML5/CSS/MVC4)
    San Fran, CA - Mar 28-30, 2012
    Dallas, TX: Apr 29-May 1, 2012
    https://agilitrain.com/Workshop/Info/Web_Workshop
  • venu1

    venu1

    Member

    2 Points

    2 Posts

    Re: Re: zoom in zoom out

    Oct 23, 2007 08:05 AM | LINK

    Thanks for your kind reply. 

    I am new to silverlight technology. If possible can you please help me with the source code to scale transform. Thank you very much.

  • cookendorfernick

    cookendorfer...

    Member

    424 Points

    99 Posts

    Re: Re: zoom in zoom out

    Oct 23, 2007 06:08 PM | LINK

    Perhaps you should start at the MSDN Libary and by downloading Microsoft Blend to begin your Silverlight development. Instead of posting and asking someone to create a project for you. Here is a link for MSDN Libary for Silverlight 1.0: http://msdn2.microsoft.com/en-us/library/bb404710.aspx

    -Nick

    Also, please "Mark As Answer" if this answered your question.
  • oniak3

    oniak3

    Member

    24 Points

    8 Posts

    Re: zoom in zoom out

    Nov 28, 2007 09:28 AM | LINK

    I've already done to apply the zooming feature for Page turn application.

    Here is my article.

    http://blogs.msdn.com/aonishi/archive/2007/11/28/how-to-add-the-zooming-feature-for-your-silverlight-page-turn-application-with-silverlight-1-0.aspx

    Hope this help.

    -Akira

     

  • WynApse

    WynApse

    Star

    14658 Points

    343 Posts

    Re: zoom in zoom out

    Nov 28, 2007 03:53 PM | LINK

    This is very cool, Akira... thanks for sharing!

    -Dave

    Stay in the 'Light
    Silverlight MVP
    http://www.wynapse.com
  • oniak3

    oniak3

    Member

    24 Points

    8 Posts

    Re: zoom in zoom out

    Nov 30, 2007 09:21 AM | LINK

  • Melt16

    Melt16

    Member

    54 Points

    62 Posts

    Re: Re: zoom in zoom out

    Feb 10, 2009 11:24 AM | LINK

    Here's an even simpler version, it simply scales a Canvas using a slider control.
    You need two Canvas controls, one for the outer Canvas, to keep the controls all in the right size, then an inner Canvas, which you can add all your scalable content to...

    The XAML

    <UserControl x:Class="SilverlightZoom.Page"

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

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

    Width="400" Height="300">

    <Grid x:Name="LayoutRoot" Background="White">

    <StackPanel>

    <Slider x:Name="Slider1" ValueChanged="Slider1_ValueChanged" Maximum="10" Width="100"></Slider>

    <Canvas Background="Blue" x:Name="Canvas1" Width="500" Height="500">

    <Canvas Background="Blue" x:Name="Canvas2" Width="500" Height="500">

    <TextBlock x:Name="TextBlock1" Foreground="White" Text="Canvas Text"></TextBlock>

    <Canvas.RenderTransform>

    <ScaleTransform x:Name="CanvasScaleTransform" ScaleX="2" ScaleY="2"></ScaleTransform>

    </Canvas.RenderTransform>

    </Canvas>

    </Canvas>

    </StackPanel>

     

    </Grid></UserControl>


    Then the Slider1_ValueChanged method...

    private void Slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)

    {

    TextBlock1.Text = Slider1.Value.ToString();

    CanvasScaleTransform.ScaleX = Slider1.Value;

    CanvasScaleTransform.ScaleY = Slider1.Value;

    }

  • @blacksilver

    @blacksilver

    Member

    20 Points

    44 Posts

    Re: Re: Re: zoom in zoom out

    Oct 03, 2009 01:48 AM | LINK

    This works for me ..........one more thing incase if slider is in childwindow and MainPage is made of mutiple usercontrols/ bands. Then i want to have the same functionality using event/delegate concept so that any control in mainpage can move according to slilder movement. Please guide me through if you have any idea.
  • oniak3

    oniak3

    Member

    24 Points

    8 Posts

    Re: Re: Re: zoom in zoom out

    Oct 03, 2009 07:13 AM | LINK

    Just the idea -- You can implement your idea by putting the ScaleTransform object with specific name into your expected object/control.  With the name, you can use FrameworkElement.FindName method to get the ScaleTransform object, and then you change the properties in runtime.