Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DrvAnyBlt (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function performs a bit-block transfer with stretching or transparency.

BOOL DrvAnyBlt(
  SURFOBJ* psoDst,
  SURFOBJ* psoSrc,
  SURFOBJ* psoMask,
  CLIPOBJ* pco,
  XLATEOBJ* pxlo,
  POINTL* pptlHTOrg,
  RECTL* prclDst,
  POINTL* pptlSrc,
  POINTL* pptlMask,
  BRUSHOBJ* pbo,
  POINTL* pptlBrush,
  ROP4 rop4,
  ULONG iMode,
  ULONG bltFlags


[in] Pointer to a SURFOBJ structure that describes the surface on which to draw.
[in] Pointer to a SURFOBJ structure that describes the source for the bit-block transfer operation, if required by the rop4 parameter.
[in] Pointer to a SURFOBJ structure that describes a surface to be used as a mask for the rop4 parameter. The mask is a bitmap with 1 bit per pixel. Typically, a mask is used to limit the area to be modified in the destination surface. Masking is selected by setting the rop4 parameter to the value 0xAACC. The destination surface is unaffected if the mask is 0x0000.

The mask is large enough to cover the destination rectangle.

If this parameter is NULL and a mask is required by the rop4 parameter, the implicit mask in the brush is used.

[in] Pointer to a CLIPOBJ structure that limits the area to be modified. GDI functions, CLIPOBJ_XXX, enumerate the clip region as a set of rectangles. Whenever possible, GDI simplifies the clipping involved; for example, this function is never called with a single clipping rectangle. GDI clips the destination rectangle before calling this function, making additional clipping unnecessary.
[in] Pointer to an XLATEOBJ structure that specifies how color indices should be translated between the source and destination surfaces. If pxlo is NULL, no translation is needed.

If the source surface is palette-managed, its colors are represented by indices into a lookup table of RGB values. The XLATEOBJ structure can be queried for a translate vector that will allow the device driver to translate any source index into a color index for the destination.

The situation is more complicated when, for example, the source is RGB, but the destination is palette-managed. In this case, the closest match to each source RGB value must be found in the destination palette. The driver can call the XLATEOBJ_iXlate function to perform this operation.

Optionally, the device driver can match colors when the target palette is the default device palette.

[in] Not used, set to NULL.
[in] Pointer to a RECTL structure that defines the area to be modified. This structure uses the coordinate system of the destination surface. The lower and right edges of this rectangle are not part of the bit-block transfer, the rectangle is lower right exclusive.

DrvBitBlt is never called with an empty destination rectangle. The two points that define the rectangle are always well ordered. However, on multiple monitor systems the rectangle may define a region larger than the destination surface. Drivers should intersect this rectangle with their surface.

[in] Pointer to a POINTL structure that defines the upper left corner of the source rectangle, if a source exists. This parameter is ignored if no source exists.
[in] Pointer to a POINTL structure that defines which pixel in the mask corresponds to the upper left corner of the source rectangle, if a source exists. This parameter is ignored if the psoMask parameter is NULL.
[in] Pointer to the brush object that defines the pattern for the bit-block transfer. GDI's BRUSHOBJ_pvGetRbrush function can be used to retrieve the device's realization of the brush. This parameter is ignored if the rop4 parameter does not require a pattern.
[in] Pointer to a POINTL structure that defines the origin of the brush in the destination surface. The upper left pixel of the brush is aligned at this point, and the brush repeats according to its dimensions. This parameter is ignored if the rop4 parameter does not require a pattern.
[in] Raster operation that defines how the mask, pattern, source, and destination pixels are combined to write to the destination surface.

This is a quaternary raster operation, which is an extension of the ternary Rop3 operation. A Rop4 has 16 relevant bits, which are similar to the 8 defining bits of a Rop3. The simplest way to implement a Rop4 is to consider its 2 bytes separately. The low byte specifies a Rop3 that should be calculated if the mask is 1, and the high byte specifies a Rop3 that can be calculated and applied if the mask is zero.

[in] Not used, set to NULL.
[in] BLT_STRETCH to indicate a stretch blit needs to be performed, otherwise set to zero.

Return Values

DrvAnyBlt returns TRUE if the bit-block transfer operation is successful. Otherwise, the function returns FALSE, and an error code is logged.


GDI calls this function when it needs to perform a StretchDIBits or StretchBlt operation.

GDI's CLIPOBJ_XXX functions allow the clipping to be reduced to a series of clipping rectangles. A translation vector assists in color index translation for palettes.

Do not dereference parameter pointers unless the ROP indicates they are needed. For example, unnecessarily dereferencing pbo — >iSolidColor for a ROP such as BLACKNESS can cause an access violation. This rule also applies to any function that includes a mix parameter.


OS Versions: Windows CE 1.0 and later.
Header: Winddi.h.
Link Library: Ddi_ati_lib.lib, Ddi_flat_lib.lib, Ddi_gx_lib.lib, Ddi_mq200_lib.lib, Ddi_nop_lib.lib, Ddi_rflat_lib.lib, Ddi_rgx_lib.lib, or Ddi_tvia5_lib.lib.

See Also

Display Drivers | DrvBitBlt | RECTL | StretchBlt | StretchDIBits | XLATEOBJ

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.

© 2015 Microsoft