]> git.sesse.net Git - vlc/blobdiff - activex/dataobject.cpp
* modules/audio_output/directx.c: backport of directx audio changes (13374). Needs...
[vlc] / activex / dataobject.cpp
index 49bf8122ddd6b0259c4638021840b4a9347653d4..992d4c99267aa21f59e2a538f2bb6755c57425c9 100644 (file)
@@ -192,18 +192,16 @@ HRESULT VLCDataObject::getMetaFileData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedi
             SIZEL size = _p_instance->getExtent();
             RECTL wBounds = { 0L, 0L, size.cx, size.cy };
 
-            LONG width = size.cx*GetDeviceCaps(hicTargetDev, LOGPIXELSX)/2540L;
-            LONG height = size.cy*GetDeviceCaps(hicTargetDev, LOGPIXELSY)/2540L;
-
             pMetaFilePict->mm   = MM_ANISOTROPIC;
             pMetaFilePict->xExt = size.cx;
             pMetaFilePict->yExt = size.cy;
 
+            DPFromHimetric(hicTargetDev, (LPPOINT)&size, 1);
+
             SetMapMode(hdcMeta, MM_ANISOTROPIC);
-            SetWindowOrgEx(hdcMeta, 0, 0, NULL);
-            SetWindowExtEx(hdcMeta, width, height, NULL);
+            SetWindowExtEx(hdcMeta, size.cx, size.cy, NULL);
 
-            RECTL bounds = { 0L, 0L, width, height };
+            RECTL bounds = { 0L, 0L, size.cx, size.cy };
 
             _p_instance->onDraw(pFormatEtc->ptd, hicTargetDev, hdcMeta, &bounds, &wBounds);
             pMetaFilePict->hMF = CloseMetaFile(hdcMeta);
@@ -230,10 +228,9 @@ HRESULT VLCDataObject::getEnhMetaFileData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pM
     {
         RECTL wBounds = { 0L, 0L, size.cx, size.cy };
 
-        LONG width = size.cx*GetDeviceCaps(hicTargetDev, LOGPIXELSX)/2540L;
-        LONG height = size.cy*GetDeviceCaps(hicTargetDev, LOGPIXELSY)/2540L;
+        DPFromHimetric(hicTargetDev, (LPPOINT)&size, 1);
 
-        RECTL bounds = { 0L, 0L, width, height };
+        RECTL bounds = { 0L, 0L, size.cx, size.cy };
 
         _p_instance->onDraw(pFormatEtc->ptd, hicTargetDev, hdcMeta, &bounds, &wBounds);
         pMedium->hEnhMetaFile = CloseEnhMetaFile(hdcMeta);
@@ -279,6 +276,11 @@ STDMETHODIMP VLCDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium,
     return E_NOTIMPL;
 };
 
+/*void VLCDataObject::onDataChange(void)
+{
+    _p_adviseHolder->SendOnDataChange(this, 0, 0);
+};*/
+
 void VLCDataObject::onClose(void)
 {
     _p_adviseHolder->SendOnDataChange(this, 0, ADVF_DATAONSTOP);