MaxScript Bitmap UI - 加载位图和格式问题

MaxScript Bitmap UI - loading bitmaps and formats questions

我是 maxscript 的新手,我想问几个关于位图的问题 UI。

rollout BitmapTestRollout "Bitmap" width:100 height:100
(
    bitmap mybitmap1 "Bitmap" pos:[25,25] width:50 height:50 fileName:"error_i.bmp"
)

我有这个简单的位图卷展栏,对此我有几个问题:

有没有办法加载 png 图像而不是 bmp 图像?我也使用 imgtag.bitmap 而不是 bitmap 但它也没有用。 我可以从外部目录加载位图吗?所有最大默认可用位图在哪里?

您可以使用最大能够读取的任何图像文件。不要使用 filename keword 参数,而是使用 bitmap 关键字参数和一个位图值(您可以使用 openBitmap 获得一个),例如:

bitmap mybitmap1 "Bitmap" pos:[25,25] width:50 height:50 bitmap:(openBitmap @"C:\temp.png")

至于使用文件名参数时可用的位图,这是maxscript reference不得不说的:

The specified file name is searched for in the following directories (in order of search): current MAXScript directory, MAXScript startup directory, MAXScript directory, 3ds Max bitmap directories, and then the 3ds Max image directory.

我更喜欢的另一种方式是: 我认为这在更多方面更易于管理和重用。

    -- your bitmap
    local thumb_1 = "D:\someimage.png"
    local thumb1 = openBitMap(thumb_1)
    imgTag thumbnail1 "logo" style:#bmp_center bitmap:thumb1 pos:[360,05] width:200 height:170