GetImageRGBA

This commit is contained in:
Garry Newman 2019-04-14 20:52:51 +01:00
parent cd30b85444
commit 8935311b03

View File

@ -55,6 +55,23 @@ public static bool GetImageSize( int image, out uint width, out uint height )
return _steamutils.GetImageSize( image, ref width, ref height );
}
/// <summary>
/// returns the image in RGBA format
/// </summary>
public static byte[] GetImageRGBA( int image )
{
if ( !GetImageSize( image, out var w, out var h ) )
return null;
var size = w * h * 4 * sizeof( char );
var data = new byte[size];
if ( !_steamutils.GetImageRGBA( image, data, data.Length ) )
return null;
return data;
}
internal static bool IsCallComplete( SteamAPICall_t call, out bool failed )
{
failed = false;