I'm new to Pocket PC programming, so maybe my question is really stupid.
I dind't find any Blit function in PocketHAL, so I assume that I have to write my own. Am I right?
I wrote this one, but I thing It's really slow:
I would appreciate any comment.
Tomas
http://www.1-easysoft.com
I dind't find any Blit function in PocketHAL, so I assume that I have to write my own. Am I right?
I wrote this one, but I thing It's really slow:
- Code:
void BitBltMasked(Surface& aDSurface, const TPoint& aPos, Surface& aSSurface, TRect& aSourceRect, uint16_t aMaskColor)
{
uint16_t *currDPix;
const uint16_t *currSPix;
uint16_t *dPixels = aDSurface.GetPixels(aPos.iX, aPos.iY);
const uint16_t *sPixels = aSSurface.GetPixels(aSourceRect.iTl.iX, aSourceRect.iTl.iY);
TInt width = aSourceRect.Width();
TInt height = aSourceRect.Height();
TInt dPitch = aDSurface.GetPitch() / 2;
TInt sPitch = aSSurface.GetPitch() / 2;
while (height--)
{
currDPix = dPixels;
currSPix = sPixels;
for (TInt cnt = 0; cnt < width; cnt++)
{
if (*currSPix++ != aMaskColor)
*currDPix = *currSPix;
currDPix++;
}
dPixels += dPitch;
sPixels += sPitch;
}
}
I would appreciate any comment.
Tomas
http://www.1-easysoft.com