Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

renderMap equivalent in maxsdk

Anonymous

renderMap equivalent in maxsdk

Anonymous
Not applicable

Hi I am aware that RenderBitmap and RenderTexmap can be used in the SDK

However, as far as I have tested, these functions work with BMM_TRUE_32

Below is my code and it fails when the bitmap is of BMM_TRUE_24 type

 

BitmapInfo newBmpInfo(bm->GetBitmapInfo());
newBmpInfo.SetWidth(newWidth);
newBmpInfo.SetHeight(newHeight);
Bitmap* newBmp = TheManager->Create(&newBmpInfo);
bmtex->RenderBitmap(GetCOREInterface()->GetTime(), newBmp, 1.0, TRUE); //This will fail if newBmpInfo is of BMM_TRUE_24 type
newBmp->OpenOutput(&newBmpInfo);
newBmp->Write(&newBmpInfo);
nnewBmp->DeleteThis();

 

I then checked renderMap in maxscript and it seems to work alright for _24 types. Any pointers to achieve similar in C++?

0 Likes
Reply
684 Views
4 Replies
Replies (4)

denisT.MaxDoctor
Advisor
Advisor

accoding to SDK <bitmap.h>:

//-- Information Only

#define BMM_TRUE_24              8    //!< 24-bit color: 8 bits each for Red, Green, and Blue. Cannot be written to.
#define BMM_TRUE_48              9    //!< 48-bit color: 16 bits each for Red, Green, and Blue. Cannot be written to.

denisT.MaxDoctor
Advisor
Advisor

there is no point in rendering in 24, as well as in 32. Render in 64, and then save it in any file format you need

0 Likes

Anonymous
Not applicable

I am trying to resize texture bitmap using RenderBitmap 

Some files don't have alpha info, and using 32 or 64 will add another channel in the default files which will increase the size of the texture on the disk. What do you think?

0 Likes

denisT.MaxDoctor
Advisor
Advisor

it is up to you how to save the bitmap to a file. For example, if you save a 64-bit bitmap as a BMP file, it will still be saved as 24-bit. If you are saving as TIF, you have the option to save with or without alpha channel. etc..

0 Likes