|
当物理LCD的大小(320X240)与皮肤中(Profile_DualSIM.ini: MAIN_LCD_WIDTH = 220 MAIN_LCD_HEIGHT = 176)所给出的大小不一致的时候, 模拟器所截的位图是放大后Enlarge(或缩小后Shrink)的图象。修正之后的物理LCD截图应为:
/*****************************************************************************
* FUNCTION
* get_mainlcd_hbitmap
* DESCRIPTION
* Allocate a BITMAP object and save the main lcd content to it
* PARAMETERS
* void
* RETURNS
* HBITMAP
*****************************************************************************/
HBITMAP get_mainlcd_hbitmap(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
HBITMAP hb;
HDC tempdc, hdc;
//---> fix by symfund
extern U32 *gdi_w32_lcd_buffer[2];
BITMAPINFO bi;
//<--- fix by symfund
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
//EnterCriticalSection(&LCD_CS);
hdc = GetDC(device.hwnd);
tempdc = CreateCompatibleDC(hdc);
hb = CreateCompatibleBitmap(hdc, LCD_WIDTH, LCD_HEIGHT);
SelectObject(tempdc, hb);
//---> fix by symfund
bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
bi.bmiHeader.biWidth = LCD_WIDTH;
bi.bmiHeader.biHeight = LCD_HEIGHT;
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 32;
bi.bmiHeader.biCompression = BI_RGB;
bi.bmiHeader.biSizeImage = LCD_WIDTH * LCD_HEIGHT * 4;
bi.bmiHeader.biClrUsed = 0;
bi.bmiHeader.biClrImportant = 0;
SetDIBits(NULL, hb, 0, LCD_HEIGHT, gdi_w32_lcd_buffer[0], &bi, DIB_RGB_COLORS);
//<--- fix by symfund
//UpdateWindow( device.hwnd );
ReleaseDC(device.hwnd, hdc);
ReleaseDC(device.hwnd, tempdc);
//LeaveCriticalSection(&LCD_CS);
return hb;
} |
|