Share via


IImagingFactory::CreateBitmapFromImage (Windows Embedded CE 6.0)

1/6/2010

This method creates an in-memory bitmap image object from another image object.

Syntax

HRESULT CreateBitmapFromImage(
  IImage*                image,
  OPTIONAL UINT          width,
  OPTIONAL UINT          height,
  OPTIONAL PixelFormatID pixelFormat,
  InterpolationHint      hints,
  IBitmapImage**         bitmap
);

Parameters

  • image
    [in] A pointer to an IImage interface containing the original image data.
  • width
    [in] A UINT value that specifies the width, in pixels, of the new bitmap image.

    Set this value to 0 create a new bitmap image that is the same height as the source image.

  • height
    [in] A UINT value that specifies the height, in pixels, of the new bitmap image.

    Set this value to 0 create a new bitmap image that is the same width as the source image.

  • pixelFormat
    [in] A PixelFormatID value that specifies the numerical format of the pixels in the image. For more information, see PixelFormat Values.

    Set this value to PixelFormatDontCare to create a new bitmap image that has the same pixel format as the source image.

  • hints
    [in] An InterpolationHint enumeration value that specifies the interpolation technique that this method should use when resizing the bitmap.
  • bitmap
    [out] A pointer to the resulting IBitmapImage interface pointer.

    Use the interface to access the bitmap image created by this method.

Return Value

If successful, this method returns S_OK.

This method may return E_POINTER if it fails.

Remarks

This method is convenient for converting a bitmap image object of one pixel format into another object of a different pixel format.

Requirements

Header imaging.h
Library Imaging.lib
Windows Embedded CE Windows CE 5.0 and later

See Also

Reference

IImagingFactory
IImage
PixelFormat Values
InterpolationHint
IBitmapImage