Back to Devexpress

ImageLoader.UseSvgImages Property

expressappframework-devexpress-dot-expressapp-dot-utils-dot-imageloader.md

latest7.6 KB
Original Source

ImageLoader.UseSvgImages Property

Enables SVG images in WinForms applications.

Namespace : DevExpress.ExpressApp.Utils

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
public bool UseSvgImages { get; set; }
vb
Public Property UseSvgImages As Boolean

Property Value

TypeDescription
Boolean

true if the SVG images are enabled for a WinForms application; otherwise, false.

|

Remarks

The Template Kit enables SVG images for all new XAF WinForms applications. For this purpose, the kit generates new projects with the FrameworkSettings.DefaultSettingsCompatibilityMode property set to Latest.

To use PNG images instead, set the UseSvgImages property to false.

If an existing XAF application was created in v18.1 or earlier, it uses PNG images. To replace them with new SVG images, do the following:

  • Check that your application uses new templates. The UseOldTemplates article demonstrates how to verify this. Old templates do not support SVG images.

  • Set the UseSvgImages property to true in the Program.cs file:

The following code snippets (auto-collected from DevExpress Examples) contain references to the UseSvgImages property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

XAF_how-to-connect-different-data-models-to-several-databases-within-a-single-application/CS/XPO/.NetFramework/TwoXpoModelsForDifferentDatabases.Win/Program.cs#L26

csharp
TwoXpoModelsForDifferentDatabasesWindowsFormsApplication winApplication = new TwoXpoModelsForDifferentDatabasesWindowsFormsApplication();
DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
winApplication.UseLightStyle = true;

xaf-how-to-extend-the-application-model/CS/ExtendModel.Win/WinApplication.cs#L17

csharp
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = false;
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
}

XAF-CRUD-for-Non-Persistent-Objects-Stored-Remotely/CS/NonPersistentObjectsDemo.Win/WinApplication.cs#L19

csharp
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = false;
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
}

XAF_Non-Persistent-Objects-Filtering-Demo/CS/NonPersistentObjectsDemo.Win/WinApplication.cs#L19

csharp
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = false;
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
}

XAF_Non-Persistent-Objects-Reloading-Demo/CS/NonPersistentObjectsDemo.Win/WinApplication.cs#L19

csharp
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = false;
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = true;
}

XAF_how-to-connect-different-data-models-to-several-databases-within-a-single-application/VB/TwoXpoModelsForDifferentDatabases.Win/Program.vb#L26

vb
Dim winApplication As TwoXpoModelsForDifferentDatabasesWindowsFormsApplication = New TwoXpoModelsForDifferentDatabasesWindowsFormsApplication()
DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True
winApplication.UseLightStyle = True

xaf-how-to-extend-the-application-model/VB/ExtendModel.Win/WinApplication.vb#L19

vb
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = False
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True
End Sub

XAF-CRUD-for-Non-Persistent-Objects-Stored-Remotely/VB/NonPersistentObjectsDemo.Win/WinApplication.vb#L21

vb
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = False
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True
End Sub

XAF_Non-Persistent-Objects-Filtering-Demo/VB/NonPersistentObjectsDemo.Win/WinApplication.vb#L21

vb
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = False
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True
End Sub

XAF_Non-Persistent-Objects-Reloading-Demo/VB/NonPersistentObjectsDemo.Win/WinApplication.vb#L21

vb
DevExpress.Persistent.Base.PasswordCryptographer.SupportLegacySha512 = False
    DevExpress.ExpressApp.Utils.ImageLoader.Instance.UseSvgImages = True
End Sub

See Also

Add and Replace Icons

Templates

ImageLoader Class

ImageLoader Members

DevExpress.ExpressApp.Utils Namespace