mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 13:45:37 +03:00
GetImageRGBA
This commit is contained in:
parent
cd30b85444
commit
8935311b03
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user