Page view counter
zoom in zoom out Subscribe to this thread
Last post 02-10-2009 7:24 AM by Melt16. 7 replies.
Sort Posts:
10-22-2007 8:26 AM
zoom in zoom out
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
venu1

Loading...
Joined on 10-22-2007
Posts 2
10-23-2007 2:35 AM
Re: zoom in zoom out

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.

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 2 and 3 Workshop
Boston, MA: April 29 - May 1
Washington, DC: June 16-18th
http://silverlight-tour.com

swildermuth

Loading...
Joined on 10-13-2003
Atlanta, GA
Posts 1,538
10-23-2007 4:05 AM
Re: Re: zoom in zoom out

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.

venu1

Loading...
Joined on 10-22-2007
Posts 2
10-23-2007 2:08 PM
Re: Re: zoom in zoom out

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.

cookendorfernick

Loading...
Joined on 09-20-2007
Posts 99
11-28-2007 5:28 AM
Re: zoom in zoom out

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

 

oniak3

Loading...
Joined on 08-15-2007
Tokyo, Japan
Posts 6
11-28-2007 11:53 AM
WynApse

Loading...
Joined on 05-13-2004
Posts 341
11-30-2007 5:21 AM
Re: zoom in zoom out
oniak3

Loading...
Joined on 08-15-2007
Tokyo, Japan
Posts 6
02-10-2009 7:24 AM
Re: Re: zoom in zoom out
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;

}

Melt16

Loading...
Joined on 10-06-2008
Posts 60
Microsoft Communities