Apply HIMETRIC transformation on icons, just like bitmaps.

This commit is contained in:
Alex Villacís Lasso 2004-08-18 00:26:44 +00:00 committed by Alexandre Julliard
parent ca7371019e
commit d44027e206

View File

@ -1264,6 +1264,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
case 0x0000: { /* ICON , first word is dwReserved */
HICON hicon;
CURSORICONFILEDIR *cifd = (CURSORICONFILEDIR*)xbuf;
HDC hdcRef;
int i;
/*
@ -1309,8 +1310,12 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
} else {
This->desc.picType = PICTYPE_ICON;
This->desc.u.icon.hicon = hicon;
This->himetricWidth = cifd->idEntries[i].bWidth;
This->himetricHeight = cifd->idEntries[i].bHeight;
This->origWidth = cifd->idEntries[i].bWidth;
This->origHeight = cifd->idEntries[i].bHeight;
hdcRef = CreateCompatibleDC(0);
This->himetricWidth =(cifd->idEntries[i].bWidth *2540)/GetDeviceCaps(hdcRef, LOGPIXELSX);
This->himetricHeight=(cifd->idEntries[i].bHeight*2540)/GetDeviceCaps(hdcRef, LOGPIXELSY);
DeleteDC(hdcRef);
hr = S_OK;
}
break;