Class DpiAware
Represents a class that provides support to get the current DPI value and calculate the values based on the current DPI values.
Inheritance
Inherited Members
Namespace: Syncfusion.WinForms.Core.Utils
Assembly: Syncfusion.Shared.Base.dll
Syntax
public static class DpiAware
Methods
GetCurrentDpi()
Gets the current DPI value of the device.
Declaration
public static float GetCurrentDpi()
Returns
| Type | Description |
|---|---|
| System.Single | Returns the current DPI value of the device. |
GetImage(Assembly, String, String)
Gets the image file from given assembly based on the DPI scaling factor. If the DPI scaling is greater than 175 then returns the high DPI image, otherwise returns the default image.
Declaration
public static Bitmap GetImage(Assembly assembly, string folderPath, string imageName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.Assembly | assembly | The System.Reflection.Assembly used to read the image file. |
| System.String | folderPath | The string contains the folder path. |
| System.String | imageName | The string value represents the name of the image file. The imageName must contains the extension like AddNewRowIcon.png or AddNewRowIcon.bmp |
Returns
| Type | Description |
|---|---|
| System.Drawing.Bitmap | Returns the image file from specified folder path. |
LogicalToDeviceUnits(Single)
Converts a logical DPI value to it's equivalent device unit DPI value.
Declaration
public static float LogicalToDeviceUnits(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | value | The logical value to convert. |
Returns
| Type | Description |
|---|---|
| System.Single | Returns the equivalent device unit DPI value. |