Home > Back-end >  This code, normally under WIN10 Windows 7 under the normal DC screen, print DC blank, for help
This code, normally under WIN10 Windows 7 under the normal DC screen, print DC blank, for help

Time:02-08

Void CopyBitmap (HWND HWND, Dbmp HBITMAP * and const HBITMAP * Sbmp)
{
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
  • Related