Garry's Mod Wiki

Garry's Mod Wiki

  string DImage:GetImage()

Description

Returns the image loaded in the image panel.

Returns

1 string
The path to the image that is loaded.

Example

Creates a frame with a randomly chosen post process effect thumbnail and prints the image path to console.

-- Frame MainFrame = vgui.Create("DFrame") MainFrame:SetSize(200, 200) MainFrame:Center() MainFrame:SetTitle("Post process effect") -- Load post process effect thumbnail local postprocess = vgui.Create("DImage", MainFrame) postprocess:SetSize(128, 128) postprocess:Center() local materials = file.Find("materials/gui/postprocess/*.png", "GAME") postprocess:SetImage("materials/gui/postprocess/"..materials[math.random(1, #materials)]) print(postprocess:GetImage())
Output:
materials/gui/postprocess/colourmod.png

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...