lv_windows_display.h

Defines

LV_WINDOWS_ZOOM_BASE_LEVEL
USER_DEFAULT_SCREEN_DPI

Functions

lv_display_t *lv_windows_create_display(const wchar_t *title, int32_t hor_res, int32_t ver_res, int32_t zoom_level, bool allow_dpi_override, bool simulator_mode)

Create a LVGL display object.

Parameters:
  • title -- The window title of LVGL display.

  • hor_res -- The horizontal resolution value of LVGL display.

  • ver_res -- The vertical resolution value of LVGL display.

  • zoom_level -- The zoom level value. Base value is 100 a.k.a 100%.

  • allow_dpi_override -- Allow DPI override if true, or follow the Windows DPI scaling setting dynamically.

  • simulator_mode -- Create simulator mode display if true, or create application mode display.

Returns:

The created LVGL display object.

HWND lv_windows_get_display_window_handle(lv_display_t *display)

Get the window handle from specific LVGL display object.

Parameters:

display -- The specific LVGL display object.

Returns:

The window handle from specific LVGL display object.

int32_t lv_windows_zoom_to_logical(int32_t physical, int32_t zoom_level)

Get logical pixel value from physical pixel value taken account with zoom level.

Remark

It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.

Parameters:
  • physical -- The physical pixel value taken account with zoom level.

  • zoom_level -- The zoom level value. Base value is 100 a.k.a 100%.

Returns:

The logical pixel value.

int32_t lv_windows_zoom_to_physical(int32_t logical, int32_t zoom_level)

Get physical pixel value taken account with zoom level from logical pixel value.

Remark

It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.

Parameters:
  • logical -- The logical pixel value.

  • zoom_level -- The zoom level value. Base value is 100 a.k.a 100%.

Returns:

The physical pixel value taken account with zoom level.

int32_t lv_windows_dpi_to_logical(int32_t physical, int32_t dpi)

Get logical pixel value from physical pixel value taken account with DPI scaling.

Remark

It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.

Parameters:
  • physical -- The physical pixel value taken account with DPI scaling.

  • dpi -- The DPI scaling value. Base value is USER_DEFAULT_SCREEN_DPI.

Returns:

The logical pixel value.

int32_t lv_windows_dpi_to_physical(int32_t logical, int32_t dpi)

Get physical pixel value taken account with DPI scaling from logical pixel value.

Remark

It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.

Parameters:
  • logical -- The logical pixel value.

  • dpi -- The DPI scaling value. Base value is USER_DEFAULT_SCREEN_DPI.

Returns:

The physical pixel value taken account with DPI scaling.