menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DpiAware - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    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
    System.Object
    DpiAware
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    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.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved