19,468
社区成员
发帖
与我相关
我的任务
分享
if (loadimage(_T("ClockBackchain.png"), &lpData, &nSize, &nHeight, &nWidth, &nPitch))
{
BITMAPINFOHEADER bih;
memset(&bih, 0, sizeof(bih));
bih.biSize = sizeof(bih);
bih.biWidth = nWidth;
bih.biHeight = nHeight;
bih.biPlanes = 1;
bih.biBitCount = 24;
bih.biSizeImage = nSize;
SetDIBitsToDevice(pDC->m_hDC, 0, 0, nWidth, nHeight, 0, 0, 0, nHeight, lpData, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
free(lpData);
}
DWORD nWidth = 32;
DWORD nHeight = 32;
PVOIL pBits = NULL;
BITMAPINFO bi;
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bi.bmiHeader.biWidth = nWidth;
bi.bmiHeader.biHeight = nHeight;
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 32;
bi.bmiHeader.biCompression = BI_RGB;
bi.bmiHeader.biSizeImage = nHeight * nWidth * 4;
CreateDIBSection(NULL, &bi, DIB_RGB_COLORS, &pBits, NULL, NULL);