Surface.CreateImage
Skip to content
mnscript
MNGuiImage Surface.CreateImage(MNGuiPanel) 

Description ​

Creates an image on the specified UI element.

Arguments ​

MNGuiPanel - The parent UI element to create the new image under.

Returns ​

MNGuiImage - The new MNGuiImage.

Example ​

msc
using Surface;
using System;

MNGuiFrame frame = Surface.CreateApplicationFrame();
MNGuiPanel pnl = frame.GetPanel();

// Creates an image and fills the screen.
MNGuiImage img = Surface.CreateImage(pnl);
img.DockFill();
img.SetUrl("https://i.imgur.com/jTJVvpa.jpeg");

// Update to add the new UI to the screen.
Surface.Update();

// Keep the program alive so the UI stays.
while(true){
    System.Sleep(1);
}