mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
(1.0.0.9) metafile
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54587 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
424f586be4
commit
c9fab49302
@ -283,6 +283,37 @@ public:
|
||||
{
|
||||
ImageUtils::GdiPlusBitmapToMediaData(&oBitmap, &m_pFrame);
|
||||
}
|
||||
else
|
||||
{
|
||||
Metafile oMeta(bsFileName);
|
||||
UINT lSrcW = oMeta.GetWidth();
|
||||
UINT lSrcH = oMeta.GetHeight();
|
||||
|
||||
if (oMeta.GetLastStatus() == Gdiplus::Ok && lSrcW > 0 && lSrcH > 0)
|
||||
{
|
||||
UINT lMaxSize = 1000;
|
||||
LONG lDstW = lSrcW;
|
||||
LONG lDstH = lSrcH;
|
||||
if (lSrcW > lMaxSize || lSrcH > lMaxSize)
|
||||
{
|
||||
double dKoef1 = (double)lMaxSize / lSrcW;
|
||||
double dKoef2 = (double)lMaxSize / lSrcH;
|
||||
double dKoef = min(dKoef1, dKoef2);
|
||||
|
||||
lDstW = (LONG)(dKoef * lSrcW);
|
||||
lDstH = (LONG)(dKoef * lSrcH);
|
||||
|
||||
Bitmap oBitmapMeta(lDstW, lDstH, PixelFormat32bppARGB);
|
||||
Graphics oGraphics(&oBitmapMeta);
|
||||
oGraphics.DrawImage(&oMeta, 0, 0, lDstW, lDstH);
|
||||
|
||||
if (oBitmapMeta.GetLastStatus() == Gdiplus::Ok)
|
||||
{
|
||||
ImageUtils::GdiPlusBitmapToMediaData(&oBitmapMeta, &m_pFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
||||
@ -227,7 +227,7 @@
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
CommandLine="..\..\..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
|
||||
ExcludedFromBuild="true"
|
||||
ExcludedFromBuild="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
|
||||
@ -2,6 +2,6 @@
|
||||
//1
|
||||
//0
|
||||
//0
|
||||
//8
|
||||
#define INTVER 1,0,0,8
|
||||
#define STRVER "1,0,0,8\0"
|
||||
//9
|
||||
#define INTVER 1,0,0,9
|
||||
#define STRVER "1,0,0,9\0"
|
||||
|
||||
Reference in New Issue
Block a user