API 参考
正在准备搜索索引…

ImGui.Image

  • 显示图像。

    参数

    user_texture_id
    bigint

    渲染器纹理标识符(ImTextureID bigint),不是 SFML 纹理对象。

    image_size

    图像显示的屏幕像素宽高,与纹理尺寸无关。

    返回值

    void

    控件:图像。

    • 关于 ImTextureID,请阅读 https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples 。

    • 'uv0' 和 'uv1' 是纹理坐标,说明见上述同一链接。

    • Image() 在每侧增加 style.ImageBorderSize 的留白。ImageButton() 左右各增加 style.FramePaddingX, 上下各增加 style.FramePaddingY。style 是 ImGui.viewImGuiStyle(styleHandle) 返回的映射视图。

    • ImageButton() 根据普通 Button() 的颜色绘制背景,并可在指定时额外绘制内部背景。

    隐含参数:uv0 = { x: 0, y: 0 }, uv1 = { x: 1, y: 1 }。

    源码与继承

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0