Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method creates an in-memory bitmap image object.

Syntax

HRESULT CreateNewBitmap(
  UINT		 
width,
  UINT		 
height,
  PixelFormatID  
pixelFormat,
  IBitmapImage** 
bitmap
);

Parameters

width

[in] A UINT value specifying the width of the bitmap in pixels.

height

[in] A UINT value specifying the height of the bitmap in pixels.

pixelFormat

[in] A PixelFormatIDvalue identifying the numerical data format of the pixels in the new bitmap. The following table shows the PixelFormat Valuesthis parameter supports.

Value Description

PixelFormat1bppIndexed

1 bit-per-pixel indexed color bitmap

PixelFormat4bppIndexed

4bpp indexed color

PixelFormat8bppIndexed

8bpp indexed color

PixelFormat16bppGrayScale

16bpp grayscale

PixelFormat16bppRGB555

16bpp RGB 5-5-5 (blue in low-order bits)

PixelFormat16bppRGB565

16bpp RGB 5-6-5

PixelFormat16bppARGB1555

16bpp ARGB 1-5-5-5

PixelFormat24bppRGB

24bpp RGB (blue in low-order byte)

PixelFormat32bppRGB

32bpp RGB (high order byte unused)

PixelFormat32bppARGB

32bpp ARGB, non-premultiplied alpha

PixelFormat32bppPARGB

32bpp ARGB, premultiplied alpha

PixelFormat48bppRGB

48bpp RGB

PixelFormat64bppARGB

64bpp ARGB, non-premultiplied alpha

PixelFormat64bppPARGB

64bpp ARGB, premultiplied alpha

bitmap

[out] A pointer to the resulting IBitmapImageinterface pointer.

Return Value

If successful, this method returns S_OK.

This method may return E_POINTER if it fails.

Requirements

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

See Also

Reference

IImagingFactory