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 is used by an image source to request that the image sink allocate a memory buffer for image pixel data.

Your image source must fill the buffer with the pixel data and then call IImageSink::ReleasePixelDataBufferto pass the data to the image sink.

If the image source obtains a buffer for pixel data in some other way, it should call IImageSink::PushPixelDatato pass the data to the image sink.

Important:
For best performance use IImageSink::GetPixelDataBufferto obtain the buffer because it will align the buffer on a 128-byte boundary as required by some hardware decoders. If IImageSink::PushPixelDatais used instead, that method will create a separate buffer that is 128-byte aligned and copy the pixel data to it. It does this even if the buffer passed to it by the image source is 128-byte aligned.

Syntax

HRESULT GetPixelDataBuffer(
  const RECT*   
rect,
  PixelFormatID 
pixelFormat,
  BOOL	
lastPass,
  BitmapData*   
bitmapData
);

Parameters

rect

[in] A pointer to a RECTstructure specifying the dimensions of the buffer for the pixel data.

pixelFormat

[in] A PixelFormatIDvalue specifying the data format for the pixels in the buffer.

lastPass

[in] A BOOL value that tells the sink whether this is the last pass over the specified image area.

Set this value to TRUE if this call to IImageSink::GetPixelDataBufferis the last pass; otherwise, set to FALSE.

bitmapData

[out] A pointer to a BitmapDataobject representing the pixel data buffer.

Return Value

If successful, this method returns S_OK.

This method may return E_NOTIMPLif it fails.

Remarks

You must call IImageSink::SetPaletteprior to sending data to the sink.

A source should only call this method if the negotiated format returned from IImageSink::BeginSinkwas the image format identifier ImageFormatMemoryBMP. For more information, see Imaging GUIDs.

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