VincentWei/MiniGUI

无后缀的图片文件显示

tirrcute opened this issue · 1 comments

您好,请问下minigui有根据文件内容判断图片格式的API嘛,目前读取一张无后缀的图片或者后缀信息错误(比如是png格式,后缀写成jpg格式)的时候bitmap好像加载不出来了。

You can do the following steps:

  1. Call MGUI_RWFromFile to create an MG_RWops object.
  2. Call CheckBitmapType function to determine the file type. This function will returns the correct extension name of the image file type if it can be distinguished by MiniGUI.
  3. Call LoadBitmapEx2 or other API to load the bitmap from the MG_RWops object and the extension name returned by CheckBitmapType.
  4. Do something with the newly loaded BITMAP object.
  5. Destroy the MG_RWops object by calling MGUI_RWclose.

Good Luck!