【 WindowLoadImage 】
格式:
WindowLoadImage(BSTR Name,
BSTR ImageId,
BSTR FileName)
中文:
WindowLoadImage(迷你視窗名稱,
圖檔ID,
檔名與目錄位置)
說明:
載入圖檔到迷你視窗,使用者必須提供圖檔的完整路徑給MushClient。
MushClient所能辨識的類型有PNG和BMP。不過BMP的相容性比較好。
範例:
WindowLoadImage (win, "im1", "C:/program files/mushclient/leaf.bmp")
視情況,路徑的一些符號可能必須加上\來避免辨識錯誤。
補充:
在Lua,使用者也可以使用 WindowLoadImageMemory 來載入記憶體的圖檔,但
只支援PNG檔案。程式作者對於這個函數,僅提供範例,而且寄生在 WindowLoadImage
條目下:
--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--
local f = assert (io.open ("sword.png", "rb")) -- open read-only, binary mode
local image_data = f:read ("*a") -- read all of it
f:close () -- close it
WindowLoadImageMemory (win, "im", image_data) -- load image from memory
WindowDrawImage (win, "im", 20, 20, 0, 0, miniwin.image_copy) -- draw it
--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--
來源:http://www.gammon.com.au/mushclient/mw_images.htm#WindowCreateImage