i am new to silverlight.
i need to create zoom in & zoom out options for an image at run time using silverlight.
please give some idea.
it is better if you explain with some code samples.
Add a ScaleTransform to your image or its container and control the ScaleX and ScaleY properties via some other input mechanism at runtime (typically a Slider control updating the scale values on the its changed event).
Consider using the Deep Zoom technology.
You should checkout vectorlight toolkit. It has out of box controls for Zoom, Pan, Magnifier features. Check Vectorlight.net site.
Related
Im writing a Windows Metro XAML based app in C#, and I want to draw grid lines with a brush on my custom grid control.
In WPF I would create a DrawingBrush to do the job, but there seems to be no equivalent in Metro ???
Does anyone know if this feature exists under another name, or that you achieve the same result differently ?
As an additional note, I do not want to draw lines etc directly on my grid (adding lines to my panel's children collection), It really needs to be done via the background property - i.e a brush.
Thanks
WinRT-XAML stack is closer to Silverlight - also in its limited graphics features when compared with Silverlight. The only TileBrush for WinRT apps is the ImageBrush, so you would need to save your drawing as an image first. You can't do that with the XAML stack either though - because there is no drawing class and WriteableBitmap has no Render() method. On the other hand - you can access DirectX for any more advanced features and combine some DirectX code with your XAML.
Anyone know how to go about achieving the tilt effect you see on Windows Phone 7 tiles or on the tiles in the Kinect UI on XBOX in WPF?
Sample screenshot:
There are a number of libraries that do it for Silverlight but all rely on the PlaneProjection which isn't in WPF.
Here is a link that shows what I mean and how to do it in Silverlight. http://www.scottlogic.co.uk/blog/colin/2011/05/metro-in-motion-part-4-tilt-effect/?utm_source=Silverlight-Zone.com&utm_medium=SilverlightZone&utm_campaign=kunal2383
Thanks
Finally I created my own Tilt effect behavior for WPF, take a look to my post and tell me what you think.
I have updated it with KeepDraging Property and TiltFactor Property and the possibility to add it directly to the panel. I hope you enjoy it now
The tilt effect on WP7 relies on PlaneProjection which is exclusive to Silverlight.
There are several projects out there that have attempted to port PlaneProject to WPF but the tilt effect itself has not been ported yet.
I have a task to build image cropping functionality in Silverlight 4.0 application. What I need to do is to have user on the left button mouse click select area to remain after cropping is applied and then call some other event (button click maybe) to apply that cropping itself.
I did develop similar functionality for rotation. I am pretty sure it is possible to do for cropping as well but that task is probably rare at this point for I can't find tutorials on the topic in the net.
If you guys can get me a snippet to begin with or point to some good tutorial about Silverlight 4.0 image cropping, I would appreciate it.
Thanks!
As far as cropping images are concerned you can use the WriteableBitmapEx library on codeplex.
Now you just need to draw a rectangle on a canvas containing the image to describe the crop region.
WPF: What is the best way to implement Zoom In and Zoom Out option for an Image inside ScrollViewer in WPF at runtime and also other alternative methods for the same
Please provide sample code and suggest links where I can find sample code and more info about various ways to Zoom the image.
Regards,
Anwar
There are many pan and zoom viewers for wpf. A few that I have found helpful to learn and to borrow code are:
WPF Extensions
http://wpfextensions.codeplex.com/
Pan and Zoom (DeepZoom style) in WPF
http://blogs.windowsclient.net/joeyw/archive/2008/08/05/pan-and-zoom-deepzoom-style-in-wpf.aspx
You could use a ScaleTransform to zoom in and out, and a TranslateTransform for panning
Has anyone been able to solve the airspace issues when trying to play a flash (swf) movie in a WPF application? I've been able to play the swf file using a WinForms control and a WindowsFormsHost element, and also using the WebBrowser element - but both have the airspace issues.
It depends on exactly what you're trying to do but I've used a transparent overlay window with success.
Track the underlying window's location and update the overlay window's position accordingly.
Ensure that you update the overlay window with minimize/restore/maximize modes.
Set the overlay window's Background to Transparent and the AllowsTransparency to true.
It's a bit of a hassle but not too bad.