VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging.Drawing Namespace / DrawingFactory Class / Default Property
Syntax Exceptions Remarks Example Requirements SeeAlso
In This Topic
    Default Property (DrawingFactory)
    In This Topic
    Gets or sets the drawing factory that is used as the default drawing factory of VintaSoft Imaging .NET SDK.
    Syntax
    'Declaration
    
    Public Shared Property Default As DrawingFactory
    
    
    public static DrawingFactory Default { get; set; }
    
    
    public: __property static DrawingFactory* get_Default();
    public: __property static void set_Default(
    DrawingFactory* value
    );
    public:
    static property DrawingFactory^ Default { DrawingFactory^ get(); void set(DrawingFactory^ value); }
    Exceptions
    ExceptionDescription
    Thrown in getter if HasDefault is false.
    Thrown in setter if value is null.
    Remarks

    VintaSoft Imaging SDK provides the following drawing engines:

    • Cross-platform drawing engine for Windows, Linux and macOS, which is based on SkiaSharp library. The drawing engine is stored in Vintasoft.Imaging.Drawing.SkiaSharp.dll assembly.
    • Drawing engine for Windows, which is based on System.Drawing.Common library.The drawing engine is stored in Vintasoft.Imaging.Gdi.dll assembly.

    Example

    Here is an example that shows how to set the default drawing factory:

    
    Class DefaultDrawingFactoryExample
        '[BLOCK:Code]
        ''' <summary>
        ''' Sets the SKIA Sharp drawing factory as a default drawing factory.
        ''' </summary>
        Public Shared Sub SetSkiaSharpSdkDrawing()
            ' Skia - cross platform drawing engine
            Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault()
        End Sub
    
        ''' <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
        '[ENDBLOCK]
    End Class
    
    Class DefaultDrawingFactoryExample2
        '[BLOCK:SetSkiaSharpSdkDrawing]
        ''' <summary>
        ''' Sets the SKIA Sharp drawing factory as a default drawing factory.
        ''' </summary>
        Public Shared Sub SetSkiaSharpSdkDrawing()
            ' Skia - cross platform drawing engine
            Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault()
        End Sub
        '[ENDBLOCK]
    
        '[BLOCK:SetGdiSdkDrawing]
        ''' <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
        '[ENDBLOCK]
    End Class
    
    
    
    namespace CSHARP
    {
        class DefaultDrawingFactoryExample
        {
            //[BLOCK:Code]
            /// <summary>
            /// Sets the SKIA Sharp drawing factory as a default drawing factory.
            /// </summary>
            public static void SetSkiaSharpSdkDrawing()
            {
                // Skia - cross platform drawing engine
                Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();
            }
    
            /// <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();
            }
            //[ENDBLOCK]
        }
    
        class DefaultDrawingFactoryExample2
        {
            //[BLOCK:SetSkiaSharpSdkDrawing]
            /// <summary>
            /// Sets the SKIA Sharp drawing factory as a default drawing factory.
            /// </summary>
            public static void SetSkiaSharpSdkDrawing()
            {
                // Skia - cross platform drawing engine
                Vintasoft.Imaging.Drawing.SkiaSharp.SkiaSharpDrawingFactory.SetAsDefault();
            }
            //[ENDBLOCK]
    
            //[BLOCK:SetGdiSdkDrawing]
            /// <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();
            }
            //[ENDBLOCK]
        }
    }
    
    

    Requirements

    Target Platforms: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also