Notifications
Clear all

[Closed] Issues resizing a image [C++ SDK]

I have a proper Bitmap* called bm, also it has a BitmapInfo called bi_input, and I want to create a resized copy and save it:


BitmapInfo bi(bi_input);
bi.SetType(BMM_FLOAT_RGBA_32);
bi.SetWidth(newWidth);
bi.SetHeight(newHeight);
bi.SetPath(resizedFilename.c_str());

Bitmap *outbm = TheManager->Create(&bi);
BMM_Color_fl fc;
outbm->CopyImage(bm, COPY_IMAGE_RESIZE_HI_QUALITY, fc);

outbm->OpenOutput(&bi);
outbm->Write(&bi);
outbm->Close(&bi);
if (bm) bm->DeleteThis();
if (outbm) outbm->DeleteThis();

First of all notice that if I don’t set type to BMM_FLOAT_RGBA_32 I get a crash :S but this current method my images look different that the original not-resized version and sometimes totally white or black.

Probably it could be a dumb question but what I’m doing wrong there?

Thank you in advance!

1 Reply

Mmm it looks that I shouldn’t trust on bi_input