Add powerful and animated zooming and panning features to your application with new ZoomPanel control

by abenedik 22. August 2008 00:40

WPF's vector based graphical engine is a perfect choice to display complex 2D diagrams, schemas, complex graphs and other graphical elements. It is often necessary for the user of the application to see the whole image and that the user can also zoom in to see the details. The WPF already provides some basic scaling and translating mechanism. But it is a long way from Scale and Translate Transform to a great user experience.

With the new ZoomPanel control this way is really short and the results are really great. All the code that is needed is:

ZoomPanel sample code

The code enables the user to zoom in, out, zoom to rectangle, pan with the mouse, use mouse wheel to zoom in and out and zoom to show the whole content of the ZoomPanel - in this case a simple TextBlock. The ZoomController is a predefined toggle buttons panel that is used to switch between different zoom modes.

But this is not all - the sweetest part of the control is that is can animate the zooming and panning! So when the user zooms in on a part of an image, the image is not just simply redrawn with the new scale factor, but the zooming is animated to look much more natural - just like the user would move his head closer.

The following screenshot shows ZoomPanel in action - taken from a sample application that comes with the package:

ZoomPanel sample application

And guess what - that is still not all.

The Ab2d.Controls.ZoomPanel library contains also a RectAnimation class (animate Rect objects) and an extended WPF's Viewbox - a ViewboxEx.

The ViewboxEx can be also very useful. With its default values it is the same as Viewbox. But it has additional Viewbox property that defines which part of ViewboxEx content will be shown - for example "0.5 0 0.5 1" shows only the right half of the content - starting at 50% and showing 50% of width.

For more information see https://www.ab4d.com/ZoomPanel.aspx.

From the page it is possible to download a 60 days evaluation version (sorry, no free version this time) or purchase a licensed version (recommended :) To make it even more attractive I have added an option to buy a full source code for the library. See https://www.ab4d.com/Purchase.aspx for more purchasing information.

As usual I am giving a launch discount - after adding items to the shipping cart enter "initialZoomPanel" into discounts textbox and click Apply.

The discount is valid only until the end of October 2008.

Tags: , ,

ZoomPanel

Added Paste2Xaml application and Ab2d.ReaderWmf class library

by abenedik 23. August 2007 16:20

Paste2Xaml is a WPF application that can read Windows metafiles (wmf), Enhanced Metafiles (emf) or get matafile objects from clipboard and can convert it into xaml. It can also export embedded images that can be used in exported xaml. The metafiles can also be imported at runtime with new Ab2d.ReaderWmf library.

The following diagram shows how it is possible to import 2D vector drawing from almost any drawing application into WPF world:

Ab2d Overview diagram

Paset2Xaml Screenshots:

Main Paste2Xaml window

Main Paste2Xaml window - a graph from Microsoft Excel 2003 has been pasted to the application (the application is already showing a WPF representation of the graph)

Export Dialog

Export Dialog - showing the xaml text and all the export options for a metafile with 2 embedded images.

The graph from Microsoft Excel 2003 shown in XamlPad

The graph from Microsoft Excel 2003 shown in XamlPad.

See www.ab4d.com/Paste2Xaml.aspx for more.

Tags: , , ,

ReaderWmf

Design user interface of your WPF application in your favorite drawing application- with new ReaderSvg library

by abenedik 23. April 2007 22:12

Imagine the following:

1.) Draw the whole user interface or just some of its elements of your WPF application in your favorite vector drawing application like Adobe® Illustrator®, CorelDRAW®, Inkscape, etc.

2.) Save your drawing into svg file format.

3.) Import your svg file into your WPF application and use it just as any other WPF UIElement.

HOW?

Simply by importing all elements from svg file into WPF application with Ab2d.ReaderSvg library.

Ab2d.ReaderSvg is a class library that can be used to read svg file and import its elements as WPF UIElements - Canvases, Paths and other shapes. Elements Stroke and Fill data are also imported. Read more about Ab2d.ReaderSvg features and usage on www.ab4d.com. On the site there is also a ReaderSvg sample applications that shows how simple is to create great animated effects, scalable vector elements, triggers to some elements and more. The sample is available with full source code.

Push your applications to the next level - forget bitmaps - use vector elements. And use your favorite vector drawing application to achieve the best results.

Tags: , , ,

ReaderSvg

Published Viewer 3D and 3ds reader

by abenedik 13. November 2005 00:16

I have written an WPF application that can be used to preview 3D objects from 3ds files. It is also possible to export the objects to xaml. The application uses some of the "cookies" of WPF like styles, transpancies, animation and triggers.

Tags: , , , ,

Reader3ds