Export (0) Print
Expand All

IImagingFactory::CreateImageFromBuffer (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This method lets the application create a decodeded image object from a buffer supplied by the application.

HRESULT CreateImageFromBuffer(
  const VOID*        buf,
  UINT               size,
  BufferDisposalFlag disposalFlag,
  IImage**           image
);

Parameters

buf
[in] A VOID pointer to the buffer containing the image data.
size
[in] A UINT value specifying the size, in bytes, of the buffer that buf points to.
disposalFlag
[in] A BufferDisposalFlag enumeration value that describes how the method should release the memory pointed to by buf after the new image is created.

If the call to the IImagingFactory::CreateImageFromBuffer method fails, the caller still retains ownership of the memory buffer, regardless of what disposalFlag is set to.

image
[out] A pointer to the resulting IImage interface pointer.

Return Values

If successful, this method returns S_OK.

If it fails, this method should return one of the following error values:

  • E_INVALIDARG
  • E_OUTOFMEMORY
  • E_POINTER

For more information, see Error Codes for the Imaging API.

Remarks

When the decoded image object is created, it only keeps a reference to the external data source and does not immediately decode the image.

The client application can request that the buffer for the resource be disposed of when the decoded image object is released by setting an appropriate value for the parameter disposalFlag.

Be aware that decoded image objects are read-only. In particular, you cannot modify the image data. However, you can display it onto a destination graphics context or push its data into an image sink. For more information, see IImage.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Imaging.h.
Link Library: Imaging.

See Also

IImagingFactory | BufferDisposalFlag | IImage


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft