Draw 2D graphics using GDI+ (System.Drawing) library
In This Topic
The Vintasoft.Imaging.dll assembly defines interfaces (
IRegion,
IDrawingPen,
IDrawingBrush,
IDrawingSolidBrush,
IDrawingHatchBrush,
IDrawingImageBrush,
IDrawingLinearGradientBrush) and abstract classes (
RasterDrawingEngine,
DrawingFactory,
DrawingFont,
DrawingFontMetrics,
GraphicsPathBase) for drawing of 2D graphics.
The Vintasoft.Imaging.Gdi.dll assembly contains implementations of interfaces and abstract classes for drawing of 2D graphics using System.Drawing (GDI+) library:
- GdiPen - defines the pen based on System.Drawing.Pen that used to draw lines and curves.
- GdiBrush - defines the abstract base class of drawing brush based on System.Drawing.Brush that used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.
- GdiSolidBrush - defines the solid brush based on System.Drawing.SolidBrush that is used to fill the interiors of graphical shapes use single color.
- GdiLinearGradientBrush - defines the linear gradient brush, which is based on System.Drawing.Drawing2D.LinearGradientBrush and paints an area with a linear gradient.
- GdiHatchBrush - defines a hatch brush based on System.Drawing.Drawing2D.HatchBrush.
- GdiImageBrush - defines the image brush based on System.Drawing.TextureBrush that uses an image to fill the interior of a shape.
- GdiFont - defines the font, which is based on System.Drawing.Font.
- GdiFontMetrics - provides the class that contains measurements for a GdiFont.
- GdiRegion - defines the region based on System.Drawing.Region that used to describe the interior of a graphics shape composed of rectangles and paths.
- GdiGraphicsPath - defines the graphics path based on System.Drawing.Drawing2D.GraphicsPath that provides series of connected lines and curves.
- GdiGraphics - provides the 2D drawing engine, which is based on GDI+ drawing surface.
- GdiGraphicsFactory - represents the drawing factory for GdiGraphics.
Also Vintasoft.Imaging.Gdi.dll assembly contains image codecs, which are implemented in System.Drawing (GDI+) library:
The Vintasoft.Imaging.dll assembly no longer depends on the System.Drawing library, and therefore the ImagePrintDocument class, which implements image and document printing using the System.Drawing (GDI+) library, has been moved to the Vintasoft.Imaging.Gdi.dll assembly.
Also the Vintasoft.Imaging.Gdi.dll assembly contains static class GdiConverter, which contains methods for conversion of Vintasoft objects to the GDI+ objects and vice versa.
VintaSoft Imaging .NET SDK 12.0 and earlier had VintasoftImage.GetImageAsBitmap method, which allowed to convert a VintasoftImage object to a System.Drawing.Bitmap object. Starting from VintaSoft Imaging .NET SDK 12.1 the Vintasoft.Imaging.dll assembly does not contain VintasoftImage.GetAsBitmap method because the Vintasoft.Imaging.dll assembly does not depend from System.Drawing library.
For backward compatibility the Vintasoft.Imaging.Gdi.dll assembly has extensions for VintasoftImage class, i.e. VintasoftImage class will have GetAsBitmap method (and all other methods, which depend from System.Drawing library) if project has reference to the Vintasoft.Imaging.Gdi.dll assembly. Also the Vintasoft.Imaging.Gdi.dll assembly contains extensions for ImageCollection and JpegFile classes.
By default the SDK will search and use the Vintasoft.Imaging.Gdi.dll assembly for drawing of 2D graphics if SDK is used in Windows.
Also it is possible to explicitly specify that SDK should use System.Drawing (GDI+) library for drawing of 2D graphics using the following code:
/// <summary>
/// Sets the GDI drawing factory as a default drawing factory.
/// </summary>
public static void SetGdiSdkDrawing()
{
// GDI - Windows graphics
Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault();
}
''' <summary>
''' Sets the GDI drawing factory as a default drawing factory.
''' </summary>
Public Shared Sub SetGdiSdkDrawing()
' GDI - Windows graphics
Vintasoft.Imaging.Drawing.Gdi.GdiGraphicsFactory.SetAsDefault()
End Sub