For a given TBitmap instance, I'm using following to try to scale it. It is able to obtain expected size, but alpha information is lost. It is expected to used only on Windows platform.
std::unique_ptr<TBitmap> ScaleBMP(TBitmap* Src, int Width, int Height)
{
assert(Src && Src->PixelFormat == pf32bit);
std::unique_ptr<TBitmap> RetVal(new TBitmap());
RetVal->SetSize(Width, Height);
RetVal->PixelFormat = pf32bit;
RetVal->Canvas->StretchDraw(TRect(0, 0, Width, Height), Src);
return std::move(RetVal);
}
It is preferred not to use additional library to manipulate BMP, although Windows library like WIC or GDI is ok. I couldn't find references about scaling BMP while preserving alpha channel.