If you want to generate/create a BMP out of selected entities then you need to use Export() method of the AcadDocument class of ActiveX Automation API of AutoCAD.
The VC++ sample below creates a BMP image out of the selection set.
// Important: check ?Use MFC? option while creating the
// ObjectARX project using ObjectARX Wizard
pApp = acedGetAcadWinApp()->GetIDispatch(TRUE);
//get the active document and selectionset
pSS = pAtvDoc->get_ActiveSelectionSet(&pSS);
pSS->SelectOnScreen();//without any filters
if(S_OK == pAtvDoc->Export(_bstr_t("c:\\test"),
acutPrintf(L"\nCreated BMP successfully.");
catch (_com_error &es)
acutPrintf(L"\nerror %s",(char *) es.Description());
Note that the bitmap is generated out of the viewable area of the current document and the size is dependent on the window size of the document while generating the bitmap.
If you want to control the size of the bitmap then before generating the bitmap, set the window size of the document using the Height() and Width() properties of IAcadDocument class. Also before changing the window size make sure that the windowState() is set to normal size. Then, zoom to the area that contains your objects, this you may have to do it programmatically after the user selects the objects on the screen.