{
Char * bits=nullptr;
The static BITMAP bm.
TCHAR Error [MAX_PATH];
GetObject (* Sbmp, sizeof (BITMAP), & amp; Bm);
Unsigned bitsize=bm. BmWidthBytes * bm. BmHeight * bm bmPlanes;
Try
{
Bits=new char [bitsize];
}
The catch (const STD: : exception& E)
{
Auto len=MultiByteToWideChar (CP_ACP, 0, e.w hat (), 1, Error, MAX_PATH);
The Error [len]='\ 0';
MessageBox (HWND, Error, NULL, MB_OK);
return;
}
GetBitmapBits (* Sbmp, bitsize, bits);
* Dbmp=CreateBitmapIndirect (& amp; Bm);
SetBitmapBits (* Dbmp bitsize, bits);
The delete [] bits;
}
CodePudding user response:
Display Settings is not 100%?Please judge each API calls return values