Hi, I'm trying to use IImage::copyToWithAlpha to overlay one image onto another one, but I'm having difficulty getting it to work. Using the nearly equivalent copyTo works fine, and I haven't been able to find any examples to suggest where I'm going wrong.
The following snippet works, and I get the result expected, the idNumberImage overlaid onto radarImageOverlaid.
Code: Select all
idNumberImage->copyTo(radarImageOverlaid,core::position2d<s32>(deltaX-10,deltaY-10),sourceRect,0);
idNumberImage and radarImageOverlaid are both IImage* types, sourceRect is the entire rectangle of radarImageOverlaid.
I've tried to use
Code: Select all
idNumberImage->copyToWithAlpha(radarImageOverlaid,core::position2d<s32>(deltaX-10,deltaY-10),sourceRect,video::SColor(255,255,255,255));
instead, so I don't block out the background image with the areas of idNumberImage that should be transparent (loaded from a png with alpha channel, either 0 or 255). However with this I only see the original image, and the copyToWithAlpha call doesn't seem to have any effect.
Has anyone used copyToWithAlpha successfully, and do you have any suggestions of what might be going wrong?