UserDisplayInfo.GetGamerPictureAsync Method

Retrieves the user’s avatar image for use with game-related apps.

Use the game picture when your title is a game or an app that is primarily oriented toward gaming, and you are displaying a picture for a user signed in to the local console. (If the user is on a remote console, you must retrieve their picture using the method described in How to: Retrieve a remote user’s picture.)

Users customize the gamer picture for game-related experiences. If your title is not a game or a game-related app, use GetApplicationPictureAsync. The “Display Name and Gamerpic” XR lists specific requirements for how user names and avatar images are displayed. Consult the XR documentation for details.

Syntax

public:
IAsyncOperation<GetPictureResult^ >^ GetGamerPictureAsync(
         UserPictureSize size,
         IBuffer^ buffer
)  

Parameters

size
Type: UserPictureSize 

An enumeration value specifying the size of the desired picture.

buffer
Type: IBuffer 

A buffer to be filled with the retrieved picture.

Return value

Type: IAsyncOperation<GetPictureResult^ > 

An interface for tracking the progress of the asynchronous call. On successful completion, the result is an object encapsulating the result of the operation.

Remarks

If a picture is returned successfully, the IBuffer object contains the bytes of a .PNG formatted image, and the IBuffer::Length property of the buffer is set to the number of bytes returned. The returned GetPictureResult::Result value indicates success, and the GetPictureResult::RequiredBufferSize value is zero.

If the size of the buffer is insufficient to hold the requested picture, the GetPictureResult::Result value is E_BOUNDS, and GetPictureResult::RequiredBufferSize is the size in bytes required for the buffer. Note that you should check the required size before allocating a buffer—picture size can be up to 2^32 bytes. If the required buffer is larger than you want your code to allocate for a picture, try specifying a smaller size value.

Note

This is a cross-OS call. For more information, see Cross-OS Calls.

Requirements

Namespace: Windows.Xbox.System

Metadata: windows.winmd

See also

Reference

UserDisplayInfo Class

UserDisplayInfo Members

Windows.Xbox.System Namespace