ReaderWmfReadGeometry Method (String) |
Namespace: Ab2d
public Image ReadGeometry( string fileName )
Drawing objects do not derive from the FrameworkElement class and provide a lighter-weight implementation for rendering shapes, images, and text. Because of this Drawing objects on one side lack support for Layout System, input, and focus, but on the other side have much better performance and lower memory consumption.
Returned Drawing has much better performance as Shapes that are returned with Read method.
If better layout support, input, focus and other functionality is needed use Read method instead that returns elements as Shapes.
It is also possible to optimize the read Drawing objects with ReadGeometry(String, GeometrySettings) method that gets the GeometrySettings objects.
The following sample reads the mySample.wmf file into sampleImage will full optimization:
Ab2d.Common.ReaderWmf.GeometrySettings settings; // gets Drawing objects optimized for best performance // NOTE: Because of heavy optimization it is possible that some anomalies appear on the image settings = Ab2d.Common.ReaderWmf.GeometrySettings.FullOptimization; Image sampleImage = myReader.ReadGeometry(@"c:\mySample.wmf", settings);
The following sample reads the mySample.wmf file into sampleImage will no optimization:
Image sampleImage = myReader.ReadGeometry(@"c:\mySample.wmf");