Commit 66227232 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

Wmf/Emf в случае растра конвертация локальная (было через gdi)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62195 954022d7-b5bf-4e40-9824-e11837661b57
parent b9225cbf
......@@ -922,6 +922,7 @@ Common/DocxFormat/Source/XML/libxml2/mac_build/libxml2/libxml2.xcodeproj/xcuserd
Common/DocxFormat/Source/XML/libxml2/mac_build/libxml2/libxml2.xcodeproj/xcuserdata/alexey.musinov.xcuserdatad svnc_tsvn_003alogminsize=5
Common/DocxFormat/Source/XML/libxml2/mac_build/libxml2/libxml2.xcodeproj/xcuserdata/alexey.musinov.xcuserdatad/xcschemes svnc_tsvn_003alogminsize=5
Common/DocxFormat/Source/XlsxFormat/ExternalLinks svnc_tsvn_003alogminsize=5
/DesktopEditor svn_global_002dignores=build%0A
DesktopEditor/ChromiumBasedEditors svnc_tsvn_003alogminsize=5
DesktopEditor/ChromiumBasedEditors/app svnc_tsvn_003alogminsize=5
DesktopEditor/ChromiumBasedEditors/app/cefbuilds svnc_tsvn_003alogminsize=5
......
......@@ -83,6 +83,7 @@ ASCOfficePPTXFile/Debug
ASCOfficePPTXFile/PPTXFormat/!_
ASCOfficePPTXFile/PPTXFormat/_
ASCOfficePPTXFile/Release
DesktopEditor/build
_tags/rev_61879/ASCImageStudio3/AVSImageRaw3/trunk/dcraw_8-94/Output
_tags/rev_61879/ASCImageStudio3/AVSImageRaw3/trunk/dcraw_8-94/Test/AVSImageRawSimpleConverter/bin
_tags/rev_61879/ASCImageStudio3/AVSImageRaw3/trunk/dcraw_8-94/Test/AVSImageRawSimpleConverter/obj
......
......@@ -20,8 +20,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
UseOfATL="0"
......@@ -180,8 +180,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
......@@ -216,7 +216,7 @@
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;../DesktopEditor/freetype-2.5.2/include&quot;;&quot;../DesktopEditor/agg-2.4/include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;DESKTOP_EDITOR_GRAPHICS"
RuntimeLibrary="1"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
......@@ -496,10 +496,18 @@
<Filter
Name="Emf"
>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfClip.cpp"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfFile.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfObjects.cpp"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfObjects.h"
>
......@@ -508,6 +516,10 @@
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfOutputDevice.h"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfPath.cpp"
>
</File>
<File
RelativePath="..\DesktopEditor\raster\Metafile\Emf\EmfPlayer.cpp"
>
......
......@@ -5,79 +5,6 @@
#if defined(_WIN32) || defined (_WIN64)
#include "../Common/GdiPlusEx.h"
#import "../Redist/ASCMediaCore3.dll" named_guids raw_interfaces_only rename_namespace("MediaCore"), exclude("tagRECT")
#include "../Common/MediaFormatDefine.h"
namespace NSGdiMeta
{
static BOOL ByteArrayToMediaData(BYTE* pArray, int nWidth, int nHeight, Aggplus::CImage** ppImage, BOOL bFlipVertical = TRUE)
{
if (!ppImage || nWidth < 1 || nHeight < 1)
return FALSE;
*ppImage = new Aggplus::CImage;
Aggplus::CImage* pImage = *ppImage;
// specify settings
long nBufferSize = 4 * nWidth * nHeight;
long nStride;
if(TRUE == bFlipVertical)
nStride = -4 * nWidth;
else
nStride = 4 * nWidth;
BYTE* pBuffer = new BYTE[nBufferSize];
memcpy(pBuffer, pArray, nBufferSize);
pImage->Create(pBuffer, nWidth, nHeight, nStride);
return TRUE;
}
static BOOL GdiPlusBitmapToMediaData(Gdiplus::Bitmap* pBitmap, Aggplus::CImage** ppImage, BOOL bFlipVertical = TRUE)
{
if (!pBitmap)
return FALSE;
int nWidth = pBitmap->GetWidth();
int nHeight = pBitmap->GetHeight();
double dHorDpi = (double)pBitmap->GetHorizontalResolution();
double dVerDpi = (double)pBitmap->GetVerticalResolution();
int nWidthDest = (int)(96.0 * nWidth / dHorDpi);
int nHeightDest = (int)(96.0 * nHeight / dVerDpi);
if (nWidth == nWidthDest && nHeight == nHeightDest)
{
Gdiplus::Rect oRect(0, 0, nWidth, nHeight);
Gdiplus::BitmapData oBitmapData;
if (pBitmap->LockBits(&oRect, Gdiplus::ImageLockModeRead, PixelFormat32bppARGB, &oBitmapData) != Gdiplus::Ok)
return FALSE;
BOOL bSuccess = ByteArrayToMediaData((BYTE*)oBitmapData.Scan0, nWidth, nHeight, ppImage, bFlipVertical);
pBitmap->UnlockBits(&oBitmapData);
return bSuccess;
}
BYTE* pData = new BYTE[4 * nWidthDest * nHeightDest];
Gdiplus::Bitmap oBitmap(nWidthDest, nHeightDest, 4 * nWidthDest, PixelFormat32bppARGB, pData);
Gdiplus::Graphics* pGraphics = Gdiplus::Graphics::FromImage(&oBitmap);
pGraphics->SetInterpolationMode(Gdiplus::InterpolationModeBilinear);
pGraphics->DrawImage(pBitmap, 0, 0, nWidthDest, nHeightDest);
RELEASEOBJECT(pGraphics);
BOOL bSuccess = ByteArrayToMediaData(pData, nWidthDest, nHeightDest, ppImage, bFlipVertical);
RELEASEARRAYOBJECTS(pData);
return bSuccess;
}
}
#else
#include <unistd.h>
#endif
......@@ -127,107 +54,6 @@ namespace NSHtmlRenderer
// Это не Wmf & Emf
m_pMetafile->Close();
#if defined(_WIN32) || defined (_WIN64)
CGdiPlusInit oCGdiPlusInit;
oCGdiPlusInit.Init();
Gdiplus::Metafile *pMetaFile = new Gdiplus::Metafile( bsFilePath.c_str() );
if ( NULL != pMetaFile )
{
// Похоже это метафайл, конвертируем его в Wmf с помощью Gdi
HENHMETAFILE hEmf = pMetaFile->GetHENHMETAFILE();
if ( NULL != hEmf )
{
UINT unSize = Gdiplus::Metafile::EmfToWmfBits( hEmf, 0, NULL, MM_ANISOTROPIC, Gdiplus::EmfToWmfBitsFlagsIncludePlaceable);
if (0 != unSize)
{
BYTE *pBuffer = new BYTE[unSize];
INT nConvertedSize = Gdiplus::Metafile::EmfToWmfBits( hEmf, unSize, pBuffer, MM_ANISOTROPIC, Gdiplus::EmfToWmfBitsFlagsEmbedEmf );
HMETAFILE hWmf = SetMetaFileBitsEx( unSize, pBuffer );
FILE *pFile = NULL;
std::wstring wstrTempFileName(m_wsTempFilePath.GetBuffer(), m_wsTempFilePath.GetLength());
WmfOpenTempFile( &wstrTempFileName, &pFile, _T("wb+"), _T(".wmf"), NULL );
if ( !pFile )
{
DeleteMetaFile( hWmf );
DeleteEnhMetaFile( hEmf );
delete[] pBuffer;
delete pMetaFile;
m_lImageType = c_lImageTypeUnknown;
}
else
{
::fclose( pFile );
// Сохраняем Wmf
HMETAFILE hTempWmf = CopyMetaFile( hWmf, m_wsTempFilePath.GetBuffer() );
DeleteMetaFile( hTempWmf );
// Открываем Wmf
if ( m_pMetafile->LoadFromFile( m_wsTempFilePath.GetBuffer()) == true)
{
// Wmf нормально открылся
if (m_pMetafile->GetType() == 1)
{
m_lImageType = c_lImageTypeMetafile | c_lMetaWmf;
DeleteMetaFile( hWmf );
DeleteEnhMetaFile( hEmf );
delete[] pBuffer;
delete pMetaFile;
return;
}
else
{
// Исходный файл Emf, но после конвертации в Wmf он не открылся
m_lImageType = c_lImageTypeMetafile | c_lMetaEmf;
}
}
else
{
// Сконвертированный файл не прочитался
m_pMetafile->Close();
m_lImageType = c_lImageTypeUnknown;
}
DeleteMetaFile( hWmf );
DeleteEnhMetaFile( hEmf );
delete[] pBuffer;
delete pMetaFile;
}
}
else
{
DeleteEnhMetaFile( hEmf );
delete pMetaFile;
}
if (TRUE)
{
Gdiplus::Bitmap* pBitmap = new Gdiplus::Bitmap(bsFilePath.c_str());
Aggplus::CImage* pImage = NULL;
BOOL bIsSuccess = NSGdiMeta::GdiPlusBitmapToMediaData(pBitmap, &pImage, FALSE);
RELEASEOBJECT(pBitmap);
if (bIsSuccess)
{
m_lImageType = c_lImageTypeBitmap;
m_pMediaData = pImage;
return;
}
RELEASEOBJECT(pImage);
return;
}
}
}
#else
#endif
//todo
{
m_pMediaData = new Aggplus::CImage(bsFilePath);
if(Aggplus::Ok == m_pMediaData->GetLastStatus())
......
......@@ -176,70 +176,5 @@ namespace NSHtmlRenderer
// path
pRenderer->PathCommandEnd();
}
//else if (2 == lFileType)
//{
// if (bIsGraphics)
// {
// pRenderer->DrawImageFromFile(strFile, dX, dY, dW, dH);
// return;
// }
// NSDocumentViewer::CDIB oSection;
// double dDpiX = 0;
// double dDpiY = 0;
// pRenderer->get_DpiX(&dDpiX);
// pRenderer->get_DpiY(&dDpiY);
// LONG lPixW = (LONG)dW * dDpiX / NSDocumentViewer::c_dInch_to_MM;
// LONG lPixH = (LONG)dH * dDpiX / NSDocumentViewer::c_dInch_to_MM;
// oSection.Create(lPixW, lPixH, dDpiX, dDpiY);
// LONG lCount = lPixW * lPixH;
// memset(oSection.m_pBits, 0xFF, 4 * lCount);
// HDC hDC = GetDC(NULL);
// HDC memDC = CreateCompatibleDC(hDC);
// ReleaseDC(0, hDC);
// HBITMAP hOldBitmap = (HBITMAP)SelectObject(memDC, oSection.m_hBitmap);
// RECT oRectPlay;
// oRectPlay.left = 0;
// oRectPlay.top = 0;
// oRectPlay.right = lPixW;
// oRectPlay.bottom = lPixH;
// HENHMETAFILE hMeta = GetEnhMetaFile(strFile);
// PlayEnhMetaFile(memDC, hMeta, &oRectPlay);
// DeleteEnhMetaFile(hMeta);
// MediaCore::IAVSUncompressedVideoFrame* pMediaData = NULL;
// CoCreateInstance(MediaCore::CLSID_CAVSUncompressedVideoFrame, NULL, CLSCTX_INPROC, MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pMediaData);
// pMediaData->put_ColorSpace(CSP_VFLIP | CSP_BGRA);
// pMediaData->put_Width(lPixW);
// pMediaData->put_Height(lPixH);
// pMediaData->SetDefaultStrides();
// pMediaData->AllocateBuffer(-1);
// BYTE* pPixels = NULL;
// pMediaData->get_Buffer(&pPixels);
// memcpy(pPixels, oSection.m_pBits, 4 * lPixW * lPixH);
// DeleteObject(hOldBitmap);
// DeleteDC(memDC);
// IUnknown* punkImage = NULL;
// pMediaData->QueryInterface(IID_IUnknown, (void**)&punkImage);
// RELEASEINTERFACE(pMediaData);
// pRenderer->DrawImage(punkImage, dX, dY, dW, dH);
// RELEASEINTERFACE(punkImage);
//}
}
}
This diff is collapsed.
......@@ -20,7 +20,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
......@@ -56,7 +56,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/Zm1000"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType&quot;;&quot;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat&quot;;&quot;../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include&quot;;&quot;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
......@@ -120,7 +120,7 @@
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
UseOfMFC="0"
......@@ -156,7 +156,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/Zm1000"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType&quot;;&quot;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat&quot;;&quot;../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include&quot;;&quot;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
......@@ -220,10 +220,10 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="1"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
......@@ -255,8 +255,8 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Zm1000"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType&quot;;&quot;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat&quot;;&quot;../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include&quot;;&quot;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
......@@ -321,10 +321,10 @@
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="1"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
......@@ -356,7 +356,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/Zm1000"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include&quot;;&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects&quot;;&quot;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType&quot;;&quot;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat&quot;;&quot;../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include&quot;;&quot;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
......
......@@ -2,6 +2,6 @@
//2
//0
//1
//314
#define INTVER 2,0,1,314
#define STRVER "2,0,1,314\0"
//320
#define INTVER 2,0,1,320
#define STRVER "2,0,1,320\0"
......@@ -17,6 +17,7 @@ using namespace NSFontCutter;
#include "WMFToImageConverter.h"
#include "../../Common/MediaFormatDefine.h"
#include "../../DesktopEditor/raster/ImageFileFormatChecker.h"
#include "../../DesktopEditor/raster/Metafile/MetaFile.h"
#include "../../DesktopEditor/raster/BgraFrame.h"
#include "../../DesktopEditor/graphics/Image.h"
......@@ -127,7 +128,7 @@ namespace NSShapeImageGen
LONG m_lDstFormat;
#ifdef BUILD_CONFIG_FULL_VERSION
NSWMFToImageConverter::CImageExt m_oExt;
NSWMFToImageConverter::CImageExt m_oImageExt;
#endif
CFontManager* m_pFontManager;
......@@ -303,7 +304,7 @@ namespace NSShapeImageGen
m_pFontManager = pFontManager;
#ifdef BUILD_CONFIG_FULL_VERSION
m_oExt.SetFontManager(pFontManager);
m_oImageExt.SetFontManager(pFontManager);
#endif
}
protected:
......@@ -477,7 +478,7 @@ namespace NSShapeImageGen
if (m_mapImagesFile.end() == pPair)
{
#ifdef BUILD_CONFIG_FULL_VERSION
LONG lImageType = m_oExt.GetImageType(strFileName);
LONG lImageType = m_oImageExt.GetImageType(strFileName);
if (1 == lImageType || 2 == lImageType)
{
......@@ -490,14 +491,13 @@ namespace NSShapeImageGen
strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem;
double dKoef = 100 * 96 / 25.4;
bool bIsSuccess = m_oExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg"));
bool bIsSuccess = m_oImageExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg"));
if (bIsSuccess)
{
if (itWMF == oInfo.m_eType) strSaveItem += _T("wmf");
else strSaveItem += _T("emf");
{//svg
if (itWMF == oInfo.m_eType) strSaveItem += _T("wmf");
else if (itEMF == oInfo.m_eType) strSaveItem += _T("emf");
OOX::CPath pathSaveItem = strSaveItem;
CDirectory::CopyFile(strFileName, pathSaveItem.GetPath(), NULL, NULL);
m_mapImagesFile.insert(std::pair<CString,CImageInfo>(strFileName, oInfo));
......@@ -506,10 +506,35 @@ namespace NSShapeImageGen
}
else
{
// wmf/emf Bitmap
::MetaFile::CMetaFile metaFileRaster(m_pFontManager->m_pApplication);
if (metaFileRaster.LoadFromFile(strFileName))
{
// wmf/emf
strSaveItem.Format(_T("image%d.png"), oInfo.m_lID);
strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem;
metaFileRaster.ConvertToRaster(strSaveItem, 4 /*CXIMAGE_FORMAT_PNG*/, lWidth, lHeight);
bIsSuccess = NSFile::CFileBinary::Exists(string2std_string(strSaveItem));
if (bIsSuccess)
{
oInfo.m_eType = itPNG;
m_mapImagesFile.insert(std::pair<CString,CImageInfo>(strSaveItem, oInfo));
m_listImages.push_back(oInfo);
return oInfo;
}
}
}
if (bIsSuccess == false)
{
NSHtmlRenderer::CASCImage oImage;
oImage.put_FontManager(m_pFontManager);
oImage.LoadFromFile(std::wstring(strFileName.GetString()));
Aggplus::CImage* pImage = oImage.get_BitmapImage();
if(NULL != pImage)
{
......@@ -559,7 +584,7 @@ namespace NSShapeImageGen
LONG lHeight = (LONG)(dHeight * 96 / 25.4);
#ifdef BUILD_CONFIG_FULL_VERSION
LONG lImageType = m_oExt.GetImageType(strFileName);
LONG lImageType = m_oImageExt.GetImageType(strFileName);
if (1 == lImageType || 2 == lImageType)
{
......@@ -573,9 +598,9 @@ namespace NSShapeImageGen
strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem;
double dKoef = 100 * 96 / 25.4;
bool bIsSuccess = m_oExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg"));
bool bIsSuccess = m_oImageExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg"));
if (bIsSuccess)
{
{//svg
if (itWMF == oInfo.m_eType) strSaveItem += _T("wmf");
else strSaveItem += _T("emf");
......
......@@ -20,7 +20,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
UseOfATL="0"
......@@ -86,7 +86,7 @@
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
......@@ -154,7 +154,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
......@@ -177,11 +177,11 @@
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
Optimization="2"
FavorSizeOrSpeed="1"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\XML;..\..\Common\ASCDocxFormat\Source;..\..\Common\DocxFormat\Source\XML\libxml2\XML\include;&quot;..\..\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_USE_MATH_DEFINES;NODOCX;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;_AVS_PPT_SHAPE_INCLUDE_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="NDEBUG;_LIB;_USE_MATH_DEFINES;NODOCX;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;_AVS_PPT_SHAPE_INCLUDE_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
......@@ -199,7 +199,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalLibraryDirectories="..\..\Common\ASCDocxFormat\Lib\Release"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
......@@ -219,7 +219,7 @@
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
......@@ -265,7 +265,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalLibraryDirectories="..\..\Common\ASCDocxFormat\Lib\Release"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
......@@ -294,6 +294,14 @@
<File
RelativePath="..\ASCOfficeDrawingConverter.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
......@@ -314,6 +322,14 @@
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
......@@ -326,6 +342,14 @@
<File
RelativePath="..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\Common\DocxFormat\Source\XML\stringcommon.cpp"
......@@ -363,6 +387,14 @@
<File
RelativePath="..\Editor\FontPicker.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\ASCPresentationEditor\OfficeDrawing\Layout.cpp"
......@@ -467,6 +499,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -1293,6 +1326,14 @@
<File
RelativePath="..\.\PPTXFormat\Logic\SpTree.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\.\PPTXFormat\Logic\SpTree.h"
......@@ -2314,6 +2355,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -2394,6 +2436,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -2466,6 +2509,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -2569,6 +2613,14 @@
<File
RelativePath="..\.\PPTXFormat\Logic\TxBody.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\.\PPTXFormat\Logic\TxBody.h"
......@@ -2646,6 +2698,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -2702,6 +2755,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -2762,6 +2816,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -2822,6 +2877,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......@@ -2902,6 +2958,7 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PrecompiledHeaderThrough="./StdAfx.h"
/>
</FileConfiguration>
......
......@@ -19,7 +19,7 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="..\Lib\Debug"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
UseOfATL="0"
......@@ -65,7 +65,7 @@
Name="VCLibrarianTool"
AdditionalDependencies="urlmon.lib"
AdditionalLibraryDirectories=""
IgnoreAllDefaultLibraries="true"
IgnoreAllDefaultLibraries="false"
/>
<Tool
Name="VCALinkTool"
......@@ -153,7 +153,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="..\Lib\Release"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
CharacterSet="1"
......@@ -197,7 +197,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalLibraryDirectories=".\..\Source\XML\libxml2\win_build\Release"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
......@@ -262,7 +262,7 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalLibraryDirectories=".\..\Source\XML\libxml2\win_build\Release"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"
......
......@@ -466,10 +466,10 @@ namespace MetaFile
double dW = dR - dL;
double dH = dB - dT;
int lL = (int)std::floor(dL + 0.5);
int lT = (int)std::floor(dT + 0.5);
int lR = (int)std::floor(dW + 0.5) + lL;
int lB = (int)std::floor(dH + 0.5) + lT;
int lL = (int)floor(dL + 0.5);
int lT = (int)floor(dT + 0.5);
int lR = (int)floor(dW + 0.5) + lL;
int lB = (int)floor(dH + 0.5) + lT;
// , oBounds, , .
m_oHeader.oFrameToBounds.lLeft = lL;
......
......@@ -174,12 +174,12 @@ namespace MetaFile
nHeight = (int)((double)nWidth * dH / dW);
}
double dDpiX, dDpiY;
oRenderer.get_DpiX(&dDpiX);
oRenderer.get_DpiX(&dDpiY);
//double dDpiX, dDpiY;
//oRenderer.get_DpiX(&dDpiX);
//oRenderer.get_DpiX(&dDpiY);
double dWidth = nWidth * 72 / 25.4 / dDpiX;
double dHeight = nHeight * 72 / 25.4 / dDpiY;
double dWidth = nWidth ;//* 72 / 25.4 / dDpiX;
double dHeight = nHeight ;//* 72 / 25.4 / dDpiY;
BYTE* pBgraData = new BYTE[nWidth * nHeight * 4];
CBgraFrame oFrame;
......
......@@ -183,8 +183,13 @@ static bool WmfOpenTempFile(std::wstring *pwsName, FILE **ppFile, wchar_t *wsMod
for (int nIndex = 0; nIndex < 1000; ++nIndex)
{
wsFileName = wsTemp;
wsFileName.append(std::to_wstring(nTime + nIndex));
#if defined(_WIN32) || defined (_WIN64)
wchar_t buff[32] ={};
_itow(nTime + nIndex, buff, 10);
wsFileName.append(buff, wcslen(buff));
#else
wsFileName.append(std::to_wstring(nTime + nIndex));
#endif
if (wsExt)
{
wsFileName.append(wsExt);
......
......@@ -50,7 +50,7 @@
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/raster.pch"
PrecompiledHeaderFile=""
AssemblerListingLocation="$(ConfigurationName)\"
ObjectFile="$(ConfigurationName)\"
ProgramDataBaseFileName="$(ConfigurationName)\"
......
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