Maintenance releases for all products are now available

by abenedik 24. February 2012 22:13

I am happy to announce that maintenance releases are now available for the following products:

  • Ab3d.Reader3ds and Viewer3ds
  • Ab3d.PowerToys
  • Ab2d.ReaderSvg and ViewerSvg
  • Ab2d.ReaderWmf and Paste2Xaml
  • ZoomPanel (evaluation version only)

 

Everybody that are using evaluation version will be happy to know that new evaluation versions of all the products now show the evaluation information dialog only once per day. Previous versions show evaluation information dialogs on each start of your application. If two or more controls were used (for example ReaderSvg and ZooomPanel) than each time you started your application two dialogs were shown. This was too annoying and is now lessened so the dialogs are shown only once per day.

Another important change in evaluation version allows you to reinstall evaluation version (the same version or newer) after 90 days from the date of installing previous evaluation version. The 60-day evaluation time limit is still the same. But with previous versions you need to contact support to extend the evaluation version after 60 days. This was not very practical when you tried an older version before some time and at that time you did not need the library or it did not have all the features you wanted. But after some time you decided to try with the new version and you were not able to install the evaluation because it has already expired. Now this is not the case any more because after 90 days you can reinstall the evaluation version again. Note that when reinstalling the same version it is recommended to uninstall it before installing it again. There is still 30 days between evaluation expiration and possibility to reinstall after 90 days - this is left to prevent continuous use of only evaluation version. But if you need to extend the 60-day period you can still contact support to extend your evaluation.

 

Of course there are also some other improvements and new features that apply for both evaluation and commercial version.

Let me start with Ab2d.ReaderSvg (and ViewerSvg). The changes in new version are:

  • Improved reading size of root svg object (improved support for viewBox and added support for preserveAspectRatio).
  • The GetXaml method now preserves the width and height in specified units (cm or inch).
  • Removed memory leak that occurred sometimes when reading embedded images.
  • Improved reading embedded images - they are now read faster and with lower memory usage.
  • Fixed problems when Path bounds were negative and IsSizeSetToPathElement in SilverlightXamlWriterSettings was set to true.
  • Prevented adding PresentationOptions:Freeze="True" text to XAML for Silverlight.
  • Added option to export for Silverlight 5.
  • Fixed reading svg file that contain links to images and were read without specifying the whole path (Read method was called only with svg file name without the full path).

 

Ab2d.ReaderWmf got the following changes:

  • Fixed leaking GDI+ handles under some circumstances. This could lead to "Cannot open wmf file!" exception after opening a few thousands metafiles.
  • The Read and ReadGeometry methods that take stream as parameter now read the metafiles directly from the stream and do not create a temp file from stream as before.

 

Changes for Ab3d.Reader3ds:

  • Improved reading textures in Model3ds and Viewport3ds. Added TexturesPath property to both controls - it can be used to specify custom textures path. If TexturesPath is not specified, the path of the 3ds file is used.
  • Added support for cameras that are children of helper objects (for example when camera is linked to a helper object so the camera is transformed as the helper object).
  • Fixed setting IsCameraAnimated property - Reader3ds sets this property to true if the 3ds file contains camera animations. Before the property could be set to true in cases when the camera was not animated.
  • Added ReadLightRange property to Reader3ds. Before the Range of PointLights and SpotLights was not read. Now it is possible to read the Range with setting ReadLightRange to true. Note that attenuation data are not present in the 3ds file - if they are used they need to be manually set to lights after the 3ds file is read.

It is also worth noting that with new version of Viewer3ds all the cameras defined in 3ds file are exported as comments in xaml. The xaml also get a description of the exported cameras. This makes switching between cameras defined in 3ds file very easy.

 

There are also a few improvements for Ab3d.PowerToys:

  • Fixed rotating with MouseCameraController and CameaControlPanel when the scene in vertically inverted when Attitude is between 90 and 270 degrees.
  • Fixed EventManager3D where under some circumstances a new object drag can be automatically stared just after end drag event.
  • Improved MaterialTypeConverter: Added support for simply defining SpecularMaterial and EmissiveMaterials. For example the "s:32;Blue" text can be used to define MaterialGroup with DiffuseMaterial and SpecularMaterial (SpecularPower = 32; SpecularBrush = White; DiffuseMaterial = Blue). The "e:Yellow" can be used to show yellow emissive material. Also improved support for defining textures path (now files from local disk and from http can be used).
  • Fixed occasional NullReferenceException in SphericalCamera when layout is updated in Visual Studio designer.

 

The commercial version of ZoomPanel was not updated.

 

I would like to conclude the blog post with something completley different - a new logo for the company AB4D d.o.o.

ab4d logo

I got the new logo from a design contest that run on 99designs.com. I was really satisfied with the contest and would really recommend that page to everyone. We are also making a redesign of the web page that will be available soon.

We are also preparing a very interesting new product (but more on that later).

I surely believe that the future is very bright for the company. I hope that our products will also make it brighter for you.

Improved Ab2d.ReaderSvg, Ab2d.ReaderWmf and ZoomPanel available

by abenedik 10. October 2011 14:23

The major improvement in this release is made in the licensing code for commercial versions of the products.

The update contains also some minor improvements in the Ab2d.ReaderSvg and Ab2d.ReaderWmf libraries and a small improvement in ViewerSvg. But let me first tell you about the changes in the commercial licensing code.

Recently a customer reported very long delays (up to 10s) when creating an instance of ZoomPanel class. After some investigation I have discovered that the delay is related to a "bug" in Microsoft's RSACryptoServiceProvider class (see http://support.microsoft.com/kb/948080). The RSACryptoServiceProvider is used to validate the license and under some circumstances the VerifyData method on the class can cause a long delay. The licensing code has been changed to prevent the delay. The problem with this bug is that the licensing code can work very well on computers where you test your products, but on some client's computer the RSACryptoServiceProvider can cause your application or product to start with a long delay.

Therefore it is highly recommended to update the products to the latest version.

But this was not the only improvement in the licensing code. Now it is possible to set the new EmbeddedLicenseAssembly property to make the check of the embedded license even faster. To understand the purpose of the new property let me first shortly describe how the licensing code works.

The licensing code in our components uses the standard .Net licensing system. This means that at compile time the compiler calls the licensing code in our products. There the developer license key is read. It is converted into a runtime license key and saved by the compiler into assemblies embedded resource. When our component is used in your application, its licensing code first tries to find the embedded runtime license key. Because our component does not know which assembly contains the embedded license key, it is usually needed to check resources in multiple assemblies before the correct one is found. To make this check much faster, it is now possible to set the static EmbeddedLicenseAssembly property to the assembly that contains the embedded license. This way the licensing code can immediately find the license key and can therefore execute much faster.

The following example sets the EmbeddedLicenseAssembly for the ZoomPanel control:

public class MyClass()
{
    public MyClass()
    {
        Ab2d.Licensing.ZoomPanel.LicenseHelper.EmbeddedLicenseAssembly
          = typeof(MyClass).Assembly;

        InitializeComponent();
    }
}

Samples for other products and some additional details about this process can be found in the new "Using commercial version" help file.

 

The improved licensing code is currently available for Ab2d.ReaderSvg, Ab2d.ReaderWmf and ZoomPanel. The fix for Ab3d.Reader3ds and Ab3d.PowerToys will be available in the following days (both libraries will have many new features that have to be finished before publishing).

 

As mentioned before, this update also brings some additional improvements to Ab2d.ReaderSvg and Ab2d.ReaderWmf.

ReaderSvg and ViewerSvg:

  • Added NameFormatString property to BaseXamlWriterSettings - it can be used to customize how the object names are written to xaml (custom prefixes and suffixes can be added to names). The export window in the ViewerSvg have two new TextBoxes that can be used to specify custom prefix and suffix that will be used to format the object names.
  • Improved reading svg image elements with added support for preserveAspectRatio property.

 

ReaderWmf:

  • Improved drawing Paths - in some cases only path stroke should be drawn without using any fill.
  • Added support for monochrome brushes.

Tags:

ReaderSvg | ReaderWmf | ZoomPanel

Update for Ab2d.ReaderSvg, Ab2d.ReaderWmf and ZoomPanel available

by abenedik 12. August 2011 20:37

I am happy to announce that all our 2D products have been updated.

The following screenshow is showing improved design time support for SvgViewbox and WmfViewbox:
SvgViewbox and WmfViewbox in Visual Studio

 

The following are the changed in Ab2d.ReadSvg:

  • Improved design time support for SvgDrawing control - now the svg file is shown in design time (before the image in design time was shown only in SvgViewbox).
  • Added SvgFileLoading and SvgFileLoaded events to SvgViewbox and SvgDrawing controls.
  • Prevented locking referenced image files.

 

The following are the changed in Ab2d.ReadWmf:

  • Added support for pattern brushes. Reading pattern brushes is turned on by default but can de disabled with setting ReadPatternBrushes to false.
  • Improved design time support for WmfViewbox and WmfDrawing controls - now the metafile is shown in design time.
  • Added MetafileLoading and MetafileLoaded events to WmfViewbox and WmfDrawing controls.
  • Fixed reading some embedded images that have their width or height negative.

Added support for pattern brushes need some additional comments because there are some differences between handling pattern brushes in GDI+ and WPF. Pattern brushes in GDI+ are not affected by the scale of the shown image. This means that if you zoom in or out of the metafile that is drawn by GDI+, the pattern brush is not scaled and is always drawn in a way that one pixel in the pattern bitmap is always rendered with one pixel.

In WPF the bitmap brushes are affected by the scale.

For example if you have a rectangle with 10 x 10 size and pattern brush from 10 x 10 bitmap and you scale the rectangle to be shown on the whole screen, the bitmap will be also scaled to the whole screen. In GDI+ the bitmap is not scaled so the pattern is still the same as when showing the rectangle without scale.

Because of this difference the imported pattern brushes can sometimes look strange. Therefore it is possible to disable reading pattern brushes with setting ReadPatternBrushes to false.

 

ZoomPanel has received the following updates:

  • Fixed problems with using None for Stretch value.
  • Improved using ViewboxLimits.

 

All the products also had a licensing issue that showed unlicensed dialog under some circumstances. This issue is now fixed.

 

As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

Tags:

ReaderSvg | ReaderWmf | ZoomPanel

New version of Ab2d.ReaderSvg available

by abenedik 1. August 2011 10:19

I am happy to announce that the new version of Ab2d.ReaderSvg library is available.

The version adds improved support for svg use and embedded svg elements. Those two svg elements are now correctly placed and have the correct size.

The new version also provides two new properties that can be used to fix problems that are caused by the differences between WPF and svg.

The first new property is SwitchElementProcessingType. It specifies which children of the svg switch element will be imported and shown. The switch element in svg file defines children that are shown based on the conditions defined in switch element. Because it is not possible to process svg conditions in WPF, it is possible to choose how the children will be imported and which children will be shown. The possible values for SwitchElementProcessingType are:

  • Disabled - svg switch element will not be imported.
  • ShowFirstDiscardOthers - only the first switch child will be imported. Other children will not be imported.
  • ShowFirstHideOthers - all switch children will be imported. Only the first element will be shown. Other children will have their Visibility set to Hidden.
  • ShowFirstCollapseOthers (default) - all switch children will be imported. Only the first element will be shown. Other children will have their Visibility set to Collapsed.
  • ShowAll - all switch children will be imported and shown.

 

The second new property is OverrideMiterLimit. The property has been added because WPF renders miter limit line cab differently as they are defined in svg specifications. The miter lime cabs show sharp line edges. But when the two lines meet at low angle, the sharp edge could extend very far away from the line junction. Therefore the miter limit can limit the sharp edges. In WPF the miter limit is used to specify how far away the sharp edge is allowed to go. In svg, the miter limit defined at which angle the miter limit is converted into beveled edge. This difference can lead to some anomalies when importing svg files. In this case the OverrideMiterLimit can be used to override the miter limit specified in the svg file and use value 1 or 2 instead.

For more information about the differences please see forum thread about this.

For backwards compatibility by default the miter limit defined in svg file is used (OverrideMiterLimit = 0).

 

Both new properties can be also set in the new ViewerSvg (here the default OverrideMiterLimit is set to 2 - miter limit of 2 is used by default).

Tags: , , ,

ReaderSvg

New maintenance release with many improvements for metafile reader

by abenedik 20. April 2011 23:42

This release brings many improvements to almost all our products.

The metafile reader (Ab2d.ReaderWmf) library got most of the changes. The svg reader (Ab2d.ReaderSvg) also got a few new features. There were also some improvements that affected all the products except ZoomPanel. ZoomPanel control was left out of this release because the library is waiting for a major upgrade. Now when this release is out I will finally start working on it (many things are already prepared - like mini map, rotate the content, zoom slider, etc. - they just need to be polished and tested).

Let me first describe the changes that affected all the products (except ZoomPanel):

  • The licensing dialogs are now created in WPF and not in Windows Forms as before (this skips loading Windows Forms and other related assemblies and therefore speeds up the application start - especially in evaluation version).
  • Improved commercial license code that tries to find embedded resources - this code is now much faster.
  • Added splash screens to all of the converter applications.

Besides the changes above the Ab3d.Reader3ds and Ab3d.PowerToys libraries did not get any new features.

 

But as mentioned before the Ab2d.ReaderWmf library was improved quite significantly. The code that transformed positions data from metafile into WPF was rewritten from ground up. The new version now enables to specify in which units the read positions will be - they can be in Pixels, Millimeters, Inches or GdiCompatable units. This can be useful when the drawing for example in Microsoft Visio is created in millimeters, the WPF elements that are created with pasting the drawing into Paste2Xaml can be also defined in millimeters. When the default Pixel units are used, the size of the read metafile is now the same as the size that is shown when the metafile is opened by Windows.

This is the list of changes in Ab2d.ReaderWmf library:

  • Added MetafileUnits property. It specifies the units in which the metafile is read. By default its value is set to Pixel. It can be also set to Millimeter, Inch or GdiCompatable. This can be useful to preserve the positions and other properties when the drawing is created in millimeter or inch units.
  • Added AutoSize property - defines if size of the root canvas is get from metafiles bounds or its frame. When bounds is used, the root canvas size is just as big as its containing objects.
  • Added GetSize(units) method that can be used to get the size of the read metafile in the specified units.
  • The size of the read metafile is now by default (if MetafileUnits is Pixel) the same as the size shown when metafile is opened by Window.
  • Improved reading metafiles that use MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH or MM_TWIPS mapping mode.
  • When reading polyline from a metafile and it has only 2 points a Line is used instead of a Polyline.
  • Added UsedMinLineWidthFactor to get the used minimal line width.
  • Improved Ab2d.Utility.ReaderWmf.ResourceDictionaryWriter - now the process of creating ResourceDictionary from metafiles can be better customized by creating a derived class.
  • Removed obsolete Ab2d.WmfViewbox control - the control has been obsolete for a few versions - Ab2d.Controls.WmfViewbox should be used instead. This also removes the need for Designer assemblies to remove the obsolete control from Designer ToolBox.

The Paste2Xaml application that can be used to simply copy objects from drawing application and paste them into XAML was also improved - support for the new features of the Ab2d.ReaderWmd library was added.

 

Some of the changes were also made in Ab2d.ReaderSvg library:

  • Markers (arrows and other line endings) are now correctly show on line and polyline elements (before they worked only on path elements).
  • markerWidth and markerHeight attributes are now correctly handled.
  • Removed obsolete Ab2d.SvgViewbox control - the control has been obsolete for a few versions - Ab2d.Controls.SvgViewbox should be used instead. This also removes the need for Designer assemblies to remove the obsolete control from Designer ToolBox.

 

Now I have to put together the new version of ZoomPanel.

Than a new exciting area awaits - Silverlght 5 with its 3D.

Tags: , , ,

Ab3d.PowerToys | Reader3ds | ReaderSvg | ReaderWmf

New version of Ab2d.ReaderSvg and ViewerSvg

by abenedik 20. August 2010 17:55

The best svg reader for WPF and svg to xaml converter for WPF and Silverlight is now even better.

This release focuses mostly on making work with Ab2d.ReaderSvg easier. Now it is possible to get progress report when reading svg files (there are also two interesting samples about this). It is now easier to use GetXaml method when the read svg file has embedded images. Also the ResourceDictionaryWriter class (helper class to create ResourceDictionaries from svg files) is now greatly improved. With new protected fields and protected virtual methods it is now very customizable.

The reading engine also has some improvements. It fixes some of the special issues that were reported by error reporting in ViewerSvg. The number or error reports is now very low and this tells that the reading engine is already very good and can handle really most of svg files.

The problems with showing the exported xaml in Visual Studio 2010 designer for Silverlight are now gone. With the new version the GetXaml method sets Width and Height to Path element when it is called to create xaml for Silverlight. This is a workaround for a bug in Visual Studio - please vote for the bug on Microsoft Connect so it will be fixed as soon as possible.

The samples have also been updated. There are now a few more samples and they are now available for both Visual Studio 2008 and 2010.

The following is a list of all changes in Ab2d.ReaderSvg:

  • Added ProgressChanged event to ReaderSvg to get report progress when reading file.
  • Improved GetXaml method for Silverlight: Added workaround for displaying Paths in Silverlight in Visual Studio 2010 designer - set Width and Height to Path element.
  • Improved GetXaml method - now the images are written to xaml without need to specify ResolveImagePath delegate. The uri format can be specified with the new DefaultImageUriFormatString property in XamlWritterSettings.
  • Improved reading linked images (not embedded into svg file). Before an exception was thrown when the image file could not be located - now the image object is created but its Source is not set.
  • Fixed reading some svg files with embedded image that reported "Invalid length for a Base-64 char array." error (used custom base64 reader instead of .Net method to read the string).
  • Fixed problems with reading svg files from Microsoft Visio that have more than one layer with the same name defined.
  • Improved ResourceDictionaryWriter class to make it much more customizable. The AddFile and AddStream methods now work correctly. The usedSvgReader, geometrySettings and xamlWritterSettings fields are now protected so they can be changed in derived class. Also the methods CreateReaderSvg, CreateXamlWriterSettings, ReadSvgFile, ReadSvgStream, GetXaml, GetRootResourceKey and ResolveResourceKeyCallback are now protected and virtual so they can be overriden in derived class.
  • Added AddHiddenElements property that specifies if hidden elements are read. If the value of AddHiddenElements is true, than hidden elements are read and have their Visibility property set to Hidden or Collapsed (depends on using display or visibility attribute in svg file).

 

 

As always the ViewerSvg application has also been improved.

As with Paste2Xaml the ViewerSvg can now also change the size of read elements to any custom size. This is not done with only adding a ScaleTransform to the root element (as in previous versions) but now the positions, sizes and other values are changed to fit into the new size.

The improvements in Ab2d.ReaderSvg are also reflected in ViewerSvg. There is now an option to read or skip reading hidden elements. The export dialog also has some new settings - see the following is a screenshot:

ViewerSvg export dialog

 

As usual the new version can be downloaded from User Account page (for commercial users) or from my Downloads page (for evaluation version).

Tags: , , ,

ReaderSvg

Improved performance of new version of ReaderSvg library

by abenedik 1. June 2010 15:33

The biggest improvement of the new version of ReaderSvg is improved performance.

To prepare the new version a lot of time was spent in a profiler. I used some very complex files from some common applications that can save drawings into svg file.

It was quickly clear that the most of the CPU cycles were spend to solve svg's style inheritance. A lot of the time was also used to resolve many possibilities to define styles in svg file (svg styles, css, attributes, ect.).

For example if we have a complex hierarchy, the root group element can define stroke thickness for the path element that is 10 children away. The process of getting the correct style declarations was before not optimal and is now much faster.

The SVG Specification allows some very complex stlye declararions that are very rarely used. The code that tries to support all the possibilities is much quite complex and takes significant time to execute. I have analyzed the svg files I have (really a lot of them - lots of them from users feedback) and found out that almost all of them are using only simple style declarations. So I have decided that by default only simple style declarations would be processed. But if needed the complex style processing can be used by setting the new OptimizeStyleProcessing property on ReaderSvg to false.

For example the following style declaration is by default not processed correctly (but magically it is read correctly with setting OptimizeStyleProcessing to false):

<defs>
   <style type="text/css"><![CDATA[
            .mummy circle, .mummy rect, .mummy polygon { fill: green}
            .mummy > .thischild { fill: red }
            .primus + .secundus { fill: red }
            .mummy circle:first-child { fill: red}
         ]]></style>
</defs>

 

Improved performance is not the only improvement. There is more:

  • Added support for text and tspan baseline-shift.
  • Now polyline and polygon are read as WPF's Polyline and Polygon elements (in previous version they were read as Path).
  • Fixed measuring size - improved for bigger stroke thickness on some shapes (when AutoSize property on ReaderSvg is true - by default).
  • Fixed SvgViewbox and SvgDrawing controls - they do not throw exceptions when Source is not set but some other property like AutoSize is set.


As usual the existing customers can download the new version from their User Account page. Others can download a 60-days trial version from my Downloads page.

Tags: , , ,

ReaderSvg