THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/07/2011 at 07:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
I'm making a BitmapSaver plugin to save images along with metadata about the scene and it all works fine until alpha channels get involved. I'm just saving the png using the BaseBitmap class and I'm passing the savebits from the BitmapSaverData Save function. When I save an image with an alpha the BitmapSaverData Save function gets called twice, the first time writes a blank image, the second time writes and image with an A_ prefix but gives an "IMAGERESULT_WRONGTYPE" error.
Here's my code such that it is minus all the metadata writing:
IMAGERESULT PNGMetaSaverData::Save(const Filename &name;, BaseBitmap *bm, BaseContainer *data, SAVEBIT savebits)
{
IMAGERESULT result;
BaseBitmap *bmp = BaseBitmap::Alloc();
bmp = bm->GetClone();// cinema crashes if I don't use a clone
result = bmp->Save(name,FILTER_PNG,data,savebits);
BaseBitmap::Free(bmp);
return result;
}
I'm still very new to c++ and I'm learning as I go so it's quite possible I made a stupid c++ mistake.
- Carter