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

(1.0.0.228) empty image

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54590 954022d7-b5bf-4e40-9824-e11837661b57
parent c9fab493
......@@ -334,7 +334,7 @@
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\Redist\VersionControl.exe &quot;$(ProjectDir)\version.h&quot;"
ExcludedFromBuild="true"
ExcludedFromBuild="false"
/>
<Tool
Name="VCCustomBuildTool"
......
......@@ -12,6 +12,7 @@ using namespace NSFontCutter;
#include "../../ASCPresentationEditor/PPTXWriter/FileDownloader.h"
#include "WMFToImageConverter.h"
#include "../../Common/MediaFormatDefine.h"
namespace NSShapeImageGen
{
......@@ -280,7 +281,56 @@ namespace NSShapeImageGen
_CopyFile(strFileSrc, strFileDst, NULL, NULL);
}
#ifdef BUILD_CONFIG_OPENSOURCE_VERSION
#ifdef BUILD_CONFIG_OPENSOURCE_VERSION
static IUnknown* CreateEmptyImage(int nWidth, int nHeight, BOOL bFlipVertical = TRUE)
{
if (nWidth < 1 || nHeight < 1)
return NULL;
MediaCore::IAVSUncompressedVideoFrame* pMediaData = NULL;
CoCreateInstance(MediaCore::CLSID_CAVSUncompressedVideoFrame, NULL, CLSCTX_ALL, MediaCore::IID_IAVSUncompressedVideoFrame, (void**)(&pMediaData));
if (NULL == pMediaData)
return NULL;
if (bFlipVertical)
pMediaData->put_ColorSpace(CSP_BGRA | CSP_VFLIP);
else
pMediaData->put_ColorSpace(CSP_BGRA);
// specify settings
pMediaData->put_Width(nWidth);
pMediaData->put_Height(nHeight);
pMediaData->put_AspectRatioX(nWidth);
pMediaData->put_AspectRatioY(nHeight);
pMediaData->put_Interlaced(VARIANT_FALSE);
pMediaData->put_Stride(0, 4*nWidth);
pMediaData->AllocateBuffer(4*nWidth*nHeight);
// allocate necesasry buffer
BYTE* pBufferPtr = 0;
long nCreatedBufferSize = 0;
pMediaData->get_Buffer(&pBufferPtr);
pMediaData->get_BufferSize(&nCreatedBufferSize);
pMediaData->put_Plane(0, pBufferPtr);
// check for valid created buffer
if (!pBufferPtr || nCreatedBufferSize != 4*nWidth*nHeight)
{
RELEASEINTERFACE(pMediaData);
return NULL;
}
// copy safearray's data to the buffer
memset(pBufferPtr, 0xFF, nCreatedBufferSize);
// save interface
IUnknown* punkInterface = NULL;
pMediaData->QueryInterface(IID_IUnknown, (void**)&punkInterface);
RELEASEINTERFACE(pMediaData);
return punkInterface;
}
void SaveImage(CString& strFileSrc, CImageInfo& oInfo, LONG __width, LONG __height)
{
OfficeCore::IImageGdipFilePtr pImageFile;
......@@ -293,6 +343,9 @@ namespace NSShapeImageGen
IUnknown* punkFrame = NULL;
pImageFile->get_Frame(&punkFrame);
if (NULL == punkFrame)
punkFrame = CreateEmptyImage(10, 10);
MediaCore::IAVSUncompressedVideoFrame* pFrame = NULL;
punkFrame->QueryInterface(MediaCore::IID_IAVSUncompressedVideoFrame, (void**)&pFrame);
......
......@@ -2,6 +2,6 @@
//1
//0
//0
//227
#define INTVER 1,0,0,227
#define STRVER "1,0,0,227\0"
//228
#define INTVER 1,0,0,228
#define STRVER "1,0,0,228\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