Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating Bitmaps of RGB888 format

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
683 Views, 0 Replies

Creating Bitmaps of RGB888 format

I am creating a bitmap and setting it as the diffuse map for an object.

I used Bitmap and BitmapInfo classes to create the bitmap from an image buffer. the bitmap is saved to a file and this bitmapInfo is used to set diffuse map of the object.

But I need to support RGB888 format without alpha.

Now I could support only RGBA8888 format.

 

How is it possible to create Bitmap with only RGB channels in 3ds max sdk?

 

the code snippet currently used is given below.

 

//creating BitmapInfo 

BitmapInfo bi;

bi.SetType( BMM_TRUE_32 );
bi.SetFlags( MAP_HAS_ALPHA );
bi.SetWidth( (WORD)width);
bi.SetHeight( (WORD)height);
bi.SetCustomFlag( 0 );
bi.SetPath(filename);

 

Bitmap cust_bmap;

cust_bmap = TheManager->Create(&bi);

 

for(int i=0;i<height;i++)

{

std::vector<BMM_Color_fl> pixelscheck( width );

//fill pixelscheck for each row 

cust_bmap->PutPixels( 0, i, width , &pixelscheck[0] )

}

 

FILE* file = _wfopen(filename,_T("wb"));
if (!file)
{
return ;
}

 

cust_bmap->OpenOutput(&bi);

cust_bmap->Write(&bi, BMM_SINGLEFRAME);
cust_bmap->Close(&bi);
fclose(file);

 

//apply it to BitmapTex

bitmaptex->SetMap(bi.GetAsset());

 

 

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report