IDXARGBReadPtr interface

The IDXARGBReadPtr interface enables Microsoft DirectX Transform objects to gain read-only access to samples contained in a DXSurface object.


The IDXARGBReadPtr interface inherits from the IUnknown interface. IDXARGBReadPtr also has these types of members:

  • Methods


The IDXARGBReadPtr interface has these methods.

Method Description

Retrieves the native underlying pixel format of a DXSurface.


Retrieves a pointer to the parent DXSurface.


Moves the sample pointer along the x-axis relative to its current position.


Moves the sample pointer to a specified row and retrieves a pointer to the run information associated with that row.


Moves the sample pointer to an absolute row along the y-axis and resets the x-axis position to zero.


Moves the sample pointer to an absolute position.


Unpacks the specified number of samples into the supplied buffer in ARGB32 pixel format. This method can only unpack a single row. Use IDXARGBReadPtr::UnpackRect to unpack multiple rows.


Unpacks the specified number of samples into the supplied buffer in alpha-premultiplied PMARGB32 pixel format. This method only unpacks a single row. Use IDXARGBReadPtr::UnpackRect to unpack multiple rows.


Unpacks a subsection of source samples defined by a rectangle structure and advances the horizontal position of the read pointer. Use to unpack multiple rows.



This interface contains methods to move a sample pointer to various locations within a DXSurface and to unpack samples into a common pixel format, either ARGB32 or PMARGB32. Unpacking the samples into a common format means transforms that modify data from DXSurfaces only need to be able to handle these two formats. If the underlying samples in the DXSurface are already in ARGB32 or PMARGB32 format, you can obtain a pointer to them by specifying NULL for the working buffer arguments, avoiding the step of copying the samples to the buffer. You can determine the format of the underlying samples by using the IDXARGBReadPtr::GetNativeType method.

Use the IDXSurface::LockSurface method to retrieve a pointer to this interface.

If you create a custom DXSurface, you must implement this interface on your DXSurface object, which is used to access samples within your custom surface. Microsoft DirectX Transform objects use this interface to access samples in your custom DXSurface.

The coordinates used in all operations for IDXARGBReadPtr and IDXARGBReadWritePtr interfaces are relative to the locked region of the DXSurface. This means, for example, that if you lock a region from (10, 10) to (100, 100) and then call pPtr->MoveToXY(10, 10), the sample pointer is positioned at the pixel at 20,20 on the surface.

Warning    To achieve fast performance on these methods, no parameter validation occurs before execution. Passing invalid parameters can cause the DLL to crash.



Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server







See also


About Transforms and DXSurfaces