If the format of the bitmap created in wince is different from that of the screen device, the bitblt function is extremely slow. Therefore, you need to create a 16-bit color 565 format bitmap, the bitmap created using this method can provide quick bitblt rendering for 1 ms. Of course, if the device is not in the 565 color format, changeCodeIn the Color Mask bits bmicolors.
//////////////////////////////////////// /// // <Br/> // // @ brief creates a cached image. <Br/> // @ Param [out] The bitmap handle generated by phbitmap. <Br/> // @ Param [out] The data location in the bitmap generated by pdata. <Br/> // @ Param [in] HDC Target DC handle. <Br/> // @ Param [in] width: the width of the bitmap. <Br/> // @ Param [in] Height: the height of the bitmap. <Br/> // @ Param [in] bitcount the number of bits per pixel. <Br/> // @ attention the created bitmap is in the non-compressed format. <Br/> // @ author loongee <br/> /// @ date 2010/01/15 <br/> //////////////// //////////////////////////////////////// ///// // <br/> void createbufferbitmap (hbitmap * phbitmap, void ** pdata, <br/> HDC, long width, long height, word bitcount) <br/>{< br/> bitmapinfo & BMP info = * (bitmapinfo *) new byte [sizeof (BMP info) + sizeof (rgbquad) * 3]; <br/> BMP info. bmiheader. bisize = sizeof (bitmapinfoheader); <br/> BMP info. bmiheader. biwidth = width; <br/> BMP info. bmiheader. biheight = height; <br/> BMP info. bmiheader. biplanes = 1; <br/> BMP info. bmiheader. bibitcount = bitcount; <br/> If (bitcount = 16) <br/>{< br/> BMP info. bmiheader. bicompression = bi_bitfields; <br/> * (DWORD *) (& BMP info. bmicolors [0]) = 0xf800; <br/> * (DWORD *) (& BMP info. bmicolors [1]) = 0x07e0; <br/> * (DWORD *) (& BMP info. bmicolors [2]) = 0x001f; <br/>}< br/> else <br/>{< br/> BMP info. bmiheader. bicompression = bi_rgb; <br/>}< br/> BMP info. bmiheader. bisizeimage = 0; <br/> BMP info. bmiheader. bixpelspermeter = 1000; <br/> BMP info. bmiheader. biypelspermeter = 1000; <br/> BMP info. bmiheader. biclrused = 0; <br/> BMP info. bmiheader. biclrimportant = 0; <br/> * phbitmap = createdibsection (HDC, & BMP info, dib_rgb_colors <br/>, pdata, null, 0 ); <br/> Delete [] (byte *) & BMP Info; <br/>}