|
|
|
|
MGL_dstTransBltCoord
Copies a block of image data with destination transparency.
Declaration
void MGLAPI MGL_dstTransBltCoord(
MGLDC *dst,
MGLDC *src,
int left,
int top,
int right,
int bottom,
int dstLeft,
int dstTop,
color_t transparent,
int op)
Prototype In
mgraph.h
Parameters
dst |
Destination device context |
src |
Source device context |
left |
Left coordinate of source image |
top |
Top coordinate of source image |
right |
Right coordinate of source image |
bottom |
Bottom coordinate of source image |
dstLeft |
Left coordinate of destination |
dstTop |
Top coordinate of destination |
transparent |
Transparent color to skip in source image |
op |
Write mode to use during Blt |
Description
Copies a block of bitmap data form one device context to another with either source or destination transparency. When transferring the data with destination transparency, pixels in the destination image that are equal to the specified transparent color will be updated, and those pixels that are not the same will be skipped. This is effectively the operation performed for 'blueScreen'ing or color keying and can also be used for drawing transparent sprites. Note however that destination transparency is very slow in software compared to source transparency!
This routine has been highly optimized for maximum performance in all pixel depths, so will provide a very fast method for performing transparent sprite animation. However you may find that if you can use alternative techniques to pre-compile the sprites (like using run length encoding etc.) you will be able to build faster software based sprite animation code that can directly access the device context surface. However this routine can also be used to perform hardware accelerated Blt's between offscreen memory device's and the display device when running in fullscreen modes, providing the hardware accelerator (if present) can support this operation. If you have a hardware accelerator capable of this, this will provide the ultimate performance for transparent sprite animation.
The source and destination rectangles are clipped according to the current clipping rectangles for the source and destination device contexts respectively.
Note: If you are doing pixel format conversion at the same time (ie: color depth for source bitmap is different to the destination bitmap), then the transparent color value must be set to the traslated destination pixel format. Ie: if you are blitting an 8bpp bitmap to a 32bpp device context, the transparent color must be a 32bpp value.
Note: This routine also only works with pixel depths that are at least 4 bits deep.
See Also
MGL_bitBlt, MGL_bitBltCoord, MGL_srcTransBlt, MGL_srcTransBltCoord, MGL_dstTransBlt, MGL_dstTransBltCoord, MGL_bitBltPatt, MGL_bitBltPattCoord, MGL_bitBltFx, MGL_bitBltFxCoord, MGL_stretchBlt, MGL_stretchBltCoord, MGL_stretchBltFx, MGL_stretchBltFxCoord, MGL_copyPage, MGL_copyPageCoord
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com