Home > Software engineering >  WinCE bitmap in the interface under the loading problem
WinCE bitmap in the interface under the loading problem

Time:09-22

Void CEliten_Teach_BoxDlg: : Load_bitmap (void)
{
CBitmap mybitmap;
Mybitmap. LoadBitmapW (IDB_BITMAP7);
The CDC * PDC=GetDC ();//to get equipment environment handle, facilitate on GDI drawing
The CDC srcDC;//add the bitmap memory DC
SrcDC. CreateCompatibleDC (PDC);//create a compatible with the window of DC, the DC is equivalent to a memory buffer
SrcDC. SelectObject (& amp; Mybitmap);//the object resources (bitmap) elected to the device to the specified environment DC in
//BOOLBitBlt (int x, int y, int nWidth, int nHeight, CDC * pSrcDC, int xSrc, int ySrc, dwords dwRop);
/* BitBlt parameters: x: target x coordinate points left upper corner of the window area
Y: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- y coordinate point
NWidth: bitmap width
Highly nHight: bitmap
The CDC * SrcDC: equipment environment pointer
XSrc: the starting point of the x coordinate equipment environment, function copies a bitmap from the starting point to the target device
YSrc: the starting point of the y coordinate equipment environment, function copies a bitmap from the starting point to the target device
DwRop: raster operation code, SRCCOPY: copy the source device area directly to the target device */
//CRect the rect.
//GetClientRect (the rect);//get the form size
PDC - & gt; BitBlt (200,0,57,30, & amp; SrcDC, 0, 0, SRCCOPY);//copy the bitmap to the window in the srcDC

//release resources
Mybitmap. DeleteObject ();
The ReleaseDC (PDC);
ReleaseDC (& amp; SrcDC);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
}
To compile code above can in Windows system, can run and display the bitmap; But under winCE devices can compile and run the process does not display bitmap, this problem bothering me for a long time, a great god genuflect is begged

CodePudding user response:

I found the reason, load in the winCE bitmap, can only load to the bottom of the window, will be covered by other controls, I want to know under the condition of without image control, how can the bitmap in the status bar shown above

CodePudding user response:

From the status bar CStatusBar derived a new class, WM_ERASEBKGND in the map
  • Related