# lv_windows_display.h (/api/public/drivers/windows/lv_windows_display_h)



<ApiSummary functions="6" typedefs="1" macros="2" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (1)&#x22;,&#x22;Other (5)&#x22;]">
  <ApiTab value="Getters (1)">
    <ApiMember kind="function" name="lv_windows_get_display_window_handle" file="public/drivers/windows/lv_windows_display.h" line="68" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L68">
      lv_windows_get_display_window_handle [#lv_windows_get_display_window_handle]

      Get the window handle from specific LVGL display object.

      ```c title=" " lineNumbers=1
      HWND lv_windows_get_display_window_handle(lv_display_t *display)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                                     | Description                       |
      | --------- | -------------------------------------------------------- | --------------------------------- |
      | `display` | <ApiLink name="lv_display_t" display="lv_display_t *" /> | The specific LVGL display object. |

      **Returns:** <ApiLink name="HWND" /> — The window handle from specific LVGL display object.
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (5)">
    <ApiMember kind="function" name="lv_windows_create_display" file="public/drivers/windows/lv_windows_display.h" line="55" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L55">
      lv_windows_create_display [#lv_windows_create_display]

      Create a LVGL display object.

      ```c title=" " lineNumbers=1
      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)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name                 | Type              | Description                                                                                            |
      | -------------------- | ----------------- | ------------------------------------------------------------------------------------------------------ |
      | `title`              | `const wchar_t *` | The window title of LVGL display.                                                                      |
      | `hor_res`            | `int32_t`         | The horizontal resolution value of LVGL display.                                                       |
      | `ver_res`            | `int32_t`         | The vertical resolution value of LVGL display.                                                         |
      | `zoom_level`         | `int32_t`         | The zoom level value. Base value is 100 a.k.a 100%.                                                    |
      | `allow_dpi_override` | `bool`            | Allow DPI override if true, or follow the Windows DPI scaling setting dynamically.                     |
      | `simulator_mode`     | `bool`            | Create simulator mode display if true (not resizable), or create application mode display (resizable). |

      **Returns:** <ApiLink name="lv_display_t" display="lv_display_t *" /> — The created LVGL display object.
    </ApiMember>

    <ApiMember kind="function" name="lv_windows_zoom_to_logical" file="public/drivers/windows/lv_windows_display.h" line="80" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L80">
      lv_windows_zoom_to_logical [#lv_windows_zoom_to_logical]

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

      ```c title=" " lineNumbers=1
      int32_t lv_windows_zoom_to_logical(int32_t physical, int32_t zoom_level)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type      | Description                                             |
      | ------------ | --------- | ------------------------------------------------------- |
      | `physical`   | `int32_t` | The physical pixel value taken account with zoom level. |
      | `zoom_level` | `int32_t` | The zoom level value. Base value is 100 a.k.a 100%.     |

      **Returns:** `int32_t` — The logical pixel value.

      <Callout type="info">
        **Remark:** It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_windows_zoom_to_physical" file="public/drivers/windows/lv_windows_display.h" line="92" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L92">
      lv_windows_zoom_to_physical [#lv_windows_zoom_to_physical]

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

      ```c title=" " lineNumbers=1
      int32_t lv_windows_zoom_to_physical(int32_t logical, int32_t zoom_level)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type      | Description                                         |
      | ------------ | --------- | --------------------------------------------------- |
      | `logical`    | `int32_t` | The logical pixel value.                            |
      | `zoom_level` | `int32_t` | The zoom level value. Base value is 100 a.k.a 100%. |

      **Returns:** `int32_t` — The physical pixel value taken account with zoom level.

      <Callout type="info">
        **Remark:** It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_windows_dpi_to_logical" file="public/drivers/windows/lv_windows_display.h" line="104" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L104">
      lv_windows_dpi_to_logical [#lv_windows_dpi_to_logical]

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

      ```c title=" " lineNumbers=1
      int32_t lv_windows_dpi_to_logical(int32_t physical, int32_t dpi)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type      | Description                                                      |
      | ---------- | --------- | ---------------------------------------------------------------- |
      | `physical` | `int32_t` | The physical pixel value taken account with DPI scaling.         |
      | `dpi`      | `int32_t` | The DPI scaling value. Base value is USER\_DEFAULT\_SCREEN\_DPI. |

      **Returns:** `int32_t` — The logical pixel value.

      <Callout type="info">
        **Remark:** It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_windows_dpi_to_physical" file="public/drivers/windows/lv_windows_display.h" line="116" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L116">
      lv_windows_dpi_to_physical [#lv_windows_dpi_to_physical]

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

      ```c title=" " lineNumbers=1
      int32_t lv_windows_dpi_to_physical(int32_t logical, int32_t dpi)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type      | Description                                                      |
      | --------- | --------- | ---------------------------------------------------------------- |
      | `logical` | `int32_t` | The logical pixel value.                                         |
      | `dpi`     | `int32_t` | The DPI scaling value. Base value is USER\_DEFAULT\_SCREEN\_DPI. |

      **Returns:** `int32_t` — The physical pixel value taken account with DPI scaling.

      <Callout type="info">
        **Remark:** It uses the same calculation style as Windows OS implementation. It will be useful for integrate LVGL Windows backend to other Windows applications.
      </Callout>
    </ApiMember>
  </ApiTab>
</ApiTabs>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="HWND" file="public/drivers/windows/lv_windows_display.h" line="37" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L37">
  HWND [#hwnd]

  ```c title=" " lineNumbers=1
  typedef struct HWND__* HWND
  ```
</ApiMember>

<TypeUsedBy name="HWND" count="4">
  * `lv_windows_get_window_context` — param `window_handle`
  * `lv_windows_pointer_device_window_message_handler` — param `hWnd`
  * `lv_windows_keypad_device_window_message_handler` — param `hWnd`
  * `lv_windows_encoder_device_window_message_handler` — param `hWnd`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LV_WINDOWS_ZOOM_BASE_LEVEL" file="public/drivers/windows/lv_windows_display.h" line="26" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L26">
  LV_WINDOWS_ZOOM_BASE_LEVEL [#lv_windows_zoom_base_level]

  ```c title=" " lineNumbers=1
  #define LV_WINDOWS_ZOOM_BASE_LEVEL 100
  ```
</ApiMember>

<ApiMember kind="macro" name="USER_DEFAULT_SCREEN_DPI" file="public/drivers/windows/lv_windows_display.h" line="29" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/drivers/windows/lv_windows_display.h#L29">
  USER_DEFAULT_SCREEN_DPI [#user_default_screen_dpi]

  ```c title=" " lineNumbers=1
  #define USER_DEFAULT_SCREEN_DPI 96
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_display.h&#x22;, &#x22;lv_indev.h&#x22;]" includedBy="[&#x22;lv_windows_input.h&#x22;, &#x22;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
