New versions of Ab2d tools and libraries

by abenedik 5. March 2008 00:20

Based on users feedback all the Ab2d tools and libraries were improved.

Paste2Xaml (utility to read Windows metafiles (wmf), Enhanced Metafiles (emf) or get matafile objects from clipboard and can convert it into xaml) and ViewerSvg (utility to convert svg and svgz files into xaml) has been improved with a zoom toolbox that enable panning and zooming (top right on the image below).

ViewerSvg application
New in Ab2d.ReaderSvg library v1.5:

  • Added support for reading svgz (compresses svg) files.
  • Fixed reading some embedded images - sometimes "Invalid character in a Base-64 string." exception was thrown.


New in Ab2d.ReaderWmf library v1.2:

  • Fixed reading some wmf files - especially files exported from Autocad are converted properly now.
  • Added MinLineWidthFactor property - useful for metafiles with lots of lines. With the property it is possible to adjust thickness of the lines.
  • Added EmbeddedBitmapImages property that replaced the obsolete MetafileImages (because of misunderstanding of the property)
  • Added support for reading pixels (individual points) from metafiles - they are converted to Ellipse elements with the specified radius.

New version is available from www.ab4d.com/Overview2d.aspx.

Thank you to all who have provided feedback on the Ab2d tools and libraries.
If you would also like to have some additional functionality or did find a file that does not work correctly, you are most welcome to inform me about it on my feedback page.
There is also a discussions group where you can post a question or see already answered ones.

Tags: , , , ,

ReaderSvg | ReaderWmf

Reading SVG images, Windows metafiles (wmf) and Enhanced Metafiles (emf) from XAML

by abenedik 4. January 2008 00:20

With new version of ReaderSvg and ReaderWmf it is now possible to read SVG, Windows metafiles (wmf) and Enhanced Metafiles (emf) from XAML.

For example:
<ab2d:SvgViewbox Source="samples/myClipart.svg"/>

SvgViewbox can be used just as Image control. Its Source property is set to the Uri of the svg file. It can be a resource, content, located on the web or on the local hard disk. It can be also used for DataBinging - for example from Combobox. For reading metafiles there is a WmfViewbox control.

There are also some other improvements and bugfixes.

New version is available from www.ab4d.com/Overview2d.aspx.

Tags: , , , ,

ReaderSvg | ReaderWmf

Greatly improved version of Reader3ds available

by abenedik 4. December 2007 22:20

Programming with 3D objects has never been easier!

With Ab3d.Reader3ds library the models and animation data can be simply imported into WPF (.Net 3.0) application. The library adjusts the model data so they WPF applications they look as in the modeling application.

All the imported models can be accessed by their name (with NamedObject property) - as they were defined in 3D modeling application.

The integrated Transformer3ds class simplifies transformations on the objects - rotation, translation, scale. Creating custom animations can be done really easily.

Playing animations stored in 3ds file is also very simple. The Reader3ds has integrated Animator3ds helper class. The only thing to do is to set the duration of the animation or the number of frames played in a second and than calling the DoAnimate method in a Timer or Render event..

Work with 3D content in WPF is now as simple as using gif or jpg images.

The following image shows sample R2D2 model rendered without using smoothing groups (left) and with using them (right - new in v4.2) - some edges are sharp and some are smooth.
Improved rendering quality with uning smoothing groups

New in version 4.2:

  • Support for smoothing groups - also automatically support flat and shaded models. This greatly improves rendering quality.
  • Added Shading property to define None, Flat, Smooth or SmoothingGroups shading. Default value is SmoothingGroups that uses the Smoothing Groups values stored in 3ds file to define which edges are smooth and which are flat. This option produces the results as in the 3d model designer. However if you wish to force the flat or smooth looking objects choose either Flat or Smooth (before reading the 3ds file). Also if performance is much more important than rendering quality choose None.
  • GetFrame can now get a frameNo as double to render the models between frames (for smoother animation)
  • Fixed bug when reading from reasource and 3ds file contains texture files (exception was thrown).
  • Also now it is possible to set TexturesPath property to url of the textures (http://...) or to the application resources ("pack://application:,,,/XAMLBrowserApplication1;component/models")
  • Added GetCameraForFrame method that gets the camera for the desired frame number - this enables creating animated cameras
  • Fixed reading material colors for some older 3ds files (in previous version reading crashed with "Non-negative number required." exception)
  • The previous version has wrongly convert position from 3ds coordinate system to wpf coordinate system. The difference is that the x axis now points to the right instead of the left and the z axis points to the viewer and not away from it. This version by default uses new coordinate system, but if your application depends on the old one, you can simple set this property to true. But note that this can only be a temporary solution. Set UseOldCoordinateAxis property to true to use old coordinate axis.
  • Added Materials property - Dictionary that can be used to access all the materials defined in 3ds by their name.
  • Added support for animated lights (PointLight - positin, color; SpotLights - position, direction, color)
  • Added GetExpirationDate method
  • Added TargetViewport - gets the viewport that was used in ReadFile
  • Added Animator3ds - helper class to simplify playing animations stored in 3ds file

Changes and fixes in Transformer3ds:

  • Fixed isAditive parameter for Scale and Translate transform
  • ObjectName can be now also Model3DGroup and not only Model3DGeometry
  • RotateObjects can now be called with RotateTransform3D - this enables setting custom center of rotation (instead of center of object)
  • Added methods without object name - to translate, rotate and scale all the objects and lights (as using constant Ab3d.Reader3ds.RootModelGroupName for objectName).
  • Added Transformer property to Reader3ds - this simplifies transforming the read objects

Reader3ds, four sample applications, help file and Viewer3sd are available from www.ab4d.com/Reader3ds.aspx.

Tags: , , ,

Reader3ds

Improved version of ReaderSvg library available.

by abenedik 14. September 2007 16:20

New in ReaderSvg library v1.3:

  • Fixed reading text for svg files created in Inkscape.
  • Added SvgBounds property (bounds of the elements in svg). Set InnerWidth and InnerHeight as obsolete.
  • Improved read svg elements so they fit correctly into parent object. For example with previous version some svg files produced Viewboxes that exceeded (or were smaller) the size of parent StackPanel. Now the Viewbox should fit correctly into StackPanel or any other element.
  • Now FillRule for Path is set to NonZero or EvenOdd.
  • Fixed some bugs that crashed the ReaderSvg.

New version is available with ViewerSvg from www.ab4d.com/ViewerSvg.aspx.

Tags: , ,

ReaderSvg

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

New ViewerSvg - SVG to XAML converter application available

by abenedik 26. July 2007 00:00

ViewerSvg is a svg to xaml converter application. It is using the Ab2d.ReaderSvg library that imports objects from svg file into WPF.

Tags: , ,

ReaderSvg

New version of ReaderSvg and ViewerSvg published.

by abenedik 9. July 2007 00:47

ReaderSvg has now improved text support. In previous version all text were converted to paths. This made simpel svg files with text very complex in WPF. In new version text that do not have some special stroke or fill is converted into simple TextBlock. There is also a new property UseSimpleText that can forec conveting text into TextBlock even if text has some special storke or fill. The svg reading is also imporved.

ViewerSvg has also been slights improved.

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

Tags: , ,

ReaderSvg