Retrieves the user’s avatar image for use with non-game-related apps.
Use the application picture when your app is not a game and not 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 application picture for non-game-related experiences. If your title is a game, or an app that relates to game experiences, use GetGamerPictureAsync. The “Display Name and Gamerpic” XR lists specific requirements for how user names and avatar images are displayed. Consult the XR documentation for details.
public:
IAsyncOperation<GetPictureResult^ >^ GetApplicationPictureAsync(
UserPictureSize size,
IBuffer^ buffer
)
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.
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.
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.
Namespace: Windows.Xbox.System
Metadata: windows.winmd