Commit c9fab493 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

(1.0.0.9) metafile

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54587 954022d7-b5bf-4e40-9824-e11837661b57
parent 424f586b
......@@ -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"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment