| 371 | } |
| 372 | |
| 373 | HICON CreateIconFromBMP(UCHAR* data) |
| 374 | { |
| 375 | BITMAPINFOHEADER* bmih = (BITMAPINFOHEADER*)(data + sizeof(BITMAPFILEHEADER)); |
| 376 | HICON hIcon = 0; |
| 377 | ICONINFO ii = {}; |
| 378 | ULONG n = bmih->biWidth * bmih->biHeight; |
| 379 | PULONG lpBits = new ULONG[n]; |
| 380 | PULONG p = lpBits; |
| 381 | if (ii.hbmColor = CreateBitmap(bmih->biWidth, bmih->biHeight, 1, bmih->biBitCount, (data + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)))) |
| 382 | { |
| 383 | if (ii.hbmMask = CreateBitmap(bmih->biWidth, bmih->biHeight, 1, 1, 0)) |
| 384 | { |
| 385 | hIcon = CreateIconIndirect(&ii); |
| 386 | DeleteObject(ii.hbmMask); |
| 387 | } |
| 388 | DeleteObject(ii.hbmColor); |
| 389 | } |
| 390 | delete[] lpBits; |
| 391 | return hIcon; |
| 392 | } |
| 393 | |
| 394 | HICON CreateIconFromResourceICO(UINT nID, int32_t cx, int32_t cy) |
| 395 | { |
nothing calls this directly
no outgoing calls
no test coverage detected