[][src]Function lvgl::widgets::img::decoder_open

pub fn decoder_open(
    dsc: *mut lv_img_decoder_dsc_t,
    src: *const c_void,
    color: lv_color_t
) -> MynewtResult<lv_res_t>

Open an image. Try the created image decoder one by one. Once one is able to open the image that decoder is save in dsc

  • dsc: describe a decoding session. Simply a pointer to an lv_img_decoder_dsc_t variable.
  • src: the image source. Can be
  1. File name: E.g. "S:folder/img1.png" (The drivers needs to registered via lv_fs_add_drv())
  2. Variable: Pointer to an lv_img_dsc_t variable
  3. Symbol: E.g. LV_SYMBOL_OK
  • color: The color of the image with LV_IMG_CF_ALPHA_... Return: LV_RES_OK: opened the image. dsc->img_data and dsc->header are set. LV_RES_INV: none of the registered image decoders were able to open the image.