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



<ApiSummary functions="6" 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="drivers/windows/lv_windows_display.h" line="67" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L67">
      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:** `HWND` — The window handle from specific LVGL display object.
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (5)">
    <ApiMember kind="function" name="lv_windows_create_display" file="drivers/windows/lv_windows_display.h" line="54" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L54">
      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`            | <ApiLink name="int32_t" /> | The horizontal resolution value of LVGL display.                                                       |
      | `ver_res`            | <ApiLink name="int32_t" /> | The vertical resolution value of LVGL display.                                                         |
      | `zoom_level`         | <ApiLink name="int32_t" /> | The zoom level value. Base value is 100 a.k.a 100%.                                                    |
      | `allow_dpi_override` | <ApiLink name="bool" />    | Allow DPI override if true, or follow the Windows DPI scaling setting dynamically.                     |
      | `simulator_mode`     | <ApiLink name="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="drivers/windows/lv_windows_display.h" line="79" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L79">
      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`   | <ApiLink name="int32_t" /> | The physical pixel value taken account with zoom level. |
      | `zoom_level` | <ApiLink name="int32_t" /> | The zoom level value. Base value is 100 a.k.a 100%.     |

      **Returns:** <ApiLink name="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="drivers/windows/lv_windows_display.h" line="91" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L91">
      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`    | <ApiLink name="int32_t" /> | The logical pixel value.                            |
      | `zoom_level` | <ApiLink name="int32_t" /> | The zoom level value. Base value is 100 a.k.a 100%. |

      **Returns:** <ApiLink name="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="drivers/windows/lv_windows_display.h" line="103" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L103">
      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` | <ApiLink name="int32_t" /> | The physical pixel value taken account with DPI scaling.         |
      | `dpi`      | <ApiLink name="int32_t" /> | The DPI scaling value. Base value is USER\_DEFAULT\_SCREEN\_DPI. |

      **Returns:** <ApiLink name="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="drivers/windows/lv_windows_display.h" line="115" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L115">
      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` | <ApiLink name="int32_t" /> | The logical pixel value.                                         |
      | `dpi`     | <ApiLink name="int32_t" /> | The DPI scaling value. Base value is USER\_DEFAULT\_SCREEN\_DPI. |

      **Returns:** <ApiLink name="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>

Macros [#macros]

<ApiMember kind="macro" name="LV_WINDOWS_ZOOM_BASE_LEVEL" file="drivers/windows/lv_windows_display.h" line="28" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L28">
  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="drivers/windows/lv_windows_display.h" line="31" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/windows/lv_windows_display.h#L31">
  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;, &#x22;windows.h&#x22;]" includedBy="[&#x22;lv_drivers.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_array.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_conf_kconfig.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
