Easily Zoom an Image in Silverlight 3 with slider control -
Simple question,
SilverLight 3 application (no toolkit) is not there. I want to use an image and a slider to fit the image on the screen, and then the slider has to zoom in and out the image, when its value changes I do not use anything else Wish, like deep zoom. How can this be done?
immediately, thanks,
XML Below code:
& lt; ScrollViewer x: Name = "Scroll" HorizontalScrollBarVisibility = "Auto" VerticalScrollBarVisibility = "Auto" HorizontalAlignment = "Muscles" VerticalAlignment = "Muscles" & gt; & Lieutenant; Layout: Layout Transformer x: name = "layout" background = "{x: tap}" & gt; & Lt; Layout: LayoutTransformer.LayoutTransform & gt; & Lt; ScaleTransform x: name = "content scale" ScaleX = "1.0" ScaleY = "1.0" /> & Lt; / Layout: LayoutTransformer.LayoutTransform & gt; & Lt; Image x: name = "img" source = "../ pin.png" & gt; & Lt; / Image & gt; & Lt; / Layout: LayoutTransformer & gt; & Lt; / ScrollViewer & gt;
and slidervaluechangedevent:
this.contentScale.ScaleX = this.contentScale.ScaleY = e.NewValue; This.layout.ApplyLayoutTransform ();
In Leauttronsformr toolkit, add the reference:
System.Windows.Controls.Layout.Toolkit
> without the toolkit, you can do it but it is not working properly (it will never update Scrolawhyr) ... try one below:
& lt ; ScrollViewer x: Name = "scroll" HorizontalScrollBarVisibility = "auto" VerticalScrollBarVisibility = "auto" HorizontalAlignment = "muscle" VerticalAlignment = "muscle" Theme: ThemeManager.StyleKey = "TreeScrollViewer" & gt; & Lt; Image x: name = "img" source = "../ charge_charglen.png" & gt; & Lt; Image.RenderTransform & gt; & Lt; ScaleTransform x: name = "content scale" ScaleX = "1.0" ScaleY = "1.0" /> & Lt; /Image.RenderTransform> & Lt; / Image & gt; & Lt; / ScrollViewer & gt;
and slidervaluechangedevent:
`this.contentScale.ScaleX = this.contentScale.ScaleY = e.NewValue`;
Hope this helps :) ....
Comments
Post a Comment