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.Windows.Forms
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)
Gets an equivalent value based on the current DPI value.
Declaration
public static float LogicalToDeviceUnits(float value)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | The float value. |
Returns
Type | Description |
---|---|
System.Single | Returns the value based on DPI value. |