DImage help.

So i want a png image inside of my derma, ive been searching for a while with no luck.

I’ve tried to use VTFedit no luck there either.


	pack = vgui.Create("DImage", frame)
		pack:SetPos(25, 25)
		pack:SetImage("fluffy/item_healthkit.png")
		pack:SizeToContents()


this is my folder path: /garrysmod/materials/fluffy

insde of there i have: item_healthkit.vtf, item_healthkit.png, item_healthkit.vmt

http://puu.sh/a41U5/5926acb2e9.jpg

This is how the png looks like, its a basic gmod healthkit.

http://puu.sh/a426d/501daa3bb6.jpg

This is the output im getting.

Do you have the icon on your client? Does it says missing material (or something similar) in your client console when you open the menu?

I do have it on my client, and no, no missing material when i open the menu

why put sizetocontents?

try
[lua]
local image= vgui.Create(“DImage”, frame)
image:SetImage(“fluffy/item_healthkit.png”)
image:SetPos(25, 25)
image:SetSize(16, 16)
[/lua]

Ok, the error is fixed thanks to Acecool, if anyone else have this, this is what worked for me:

replace SetImage(“item_healthkit.png”)
with
SetMaterial(“item_healthkit.png”)