Files
sbox-public/engine/Sandbox.Tools/Utility/Utility.Bitmap.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

22 lines
431 B
C#

using Sandbox.Utility;
namespace Editor;
public static partial class EditorUtility
{
/// <summary>
/// Load a float bitmap. This is usually a png, tga, exr, psd
/// </summary>
public static FloatBitmap LoadBitmap( string filename )
{
var bm = FloatBitMap_t.Create();
if ( !bm.LoadFromFile( filename, FBMGammaType_t.FBM_GAMMA_LINEAR ) )
{
bm.Delete();
return default;
}
return new FloatBitmap( bm );
}
}