ID2D1DeviceContext2::CreateImageSourceFromWic(IWICBitmapSource*,D2D1_IMAGE_SOURCE_LOADING_OPTIONS,ID2D1ImageSourceFromWic**) method (d2d1_3.h)
Creates an image source object from a WIC bitmap source, while populating all pixel memory within the image source.
The image is loaded and stored while using a minimal amount of memory.
Syntax
HRESULT CreateImageSourceFromWic(
[in] IWICBitmapSource *wicBitmapSource,
D2D1_IMAGE_SOURCE_LOADING_OPTIONS loadingOptions,
[out] ID2D1ImageSourceFromWic **imageSource
);
Parameters
[in] wicBitmapSource
Type: IWICBitmapSource*
The WIC bitmap source to create the image source from.
loadingOptions
Type: D2D1_IMAGE_SOURCE_LOADING_OPTIONS
Options for creating the image source. Default options are used if NULL.
[out] imageSource
Type: ID2D1ImageSourceFromWic**
Receives the new image source instance.
Return value
Type: HRESULT
S_OK if successful, otherwise a failure HRESULT.
Remarks
This method creates an image source which can be used to draw the image.
This method supports images that exceed the maximum texture size. Large images are internally stored within a sparse tile cache.
This API supports the same set of pixel formats and alpha modes supported by CreateBitmapFromWicBitmap.
If the GPU does not support a given pixel format,
this method will return D2DERR_UNSUPPORTED_PIXEL_FORMAT. This method does not apply adjustments such as gamma
or alpha premultiplication which affect the appearance of the image.
This method automatically selects an appropriate storage format to minimize GPU memory usage., such as using separate luminance and chrominance textures for JPEG images.
If the loadingOptions argument is NULL, D2D uses D2D1_IMAGE_SOURCE_LOADING_OPTIONS_NONE.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 10 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2016 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | d2d1_3.h |
DLL | D2d1.dll |