1) docbuilder : save to image support

2) docbuilder : add save params
3) IOfficeDrawingFile : set sizes for save to raster
This commit is contained in:
Oleg Korshul
2016-10-21 17:31:30 +03:00
parent 2c46ec3123
commit a66cd47c4e
13 changed files with 41 additions and 24 deletions

View File

@ -207,7 +207,7 @@ void CDjVuFileImplementation::DrawPageOnRenderer(IRenderer* pRende
// белая страница
}
}
void CDjVuFileImplementation::ConvertToRaster(int nPageIndex, const std::wstring& wsDstPath, int nImageType)
void CDjVuFileImplementation::ConvertToRaster(int nPageIndex, const std::wstring& wsDstPath, int nImageType, const int& nRasterW, const int& nRasterH)
{
if (!m_pApplicationFonts)
return;
@ -224,8 +224,8 @@ void CDjVuFileImplementation::ConvertToRaster(int nPageIndex, cons
double dWidth, dHeight;
GetPageInfo(nPageIndex, &dWidth, &dHeight, &dPageDpiX, &dPageDpiX);
int nWidth = (int)dWidth * 96 / dPageDpiX;
int nHeight = (int)dHeight * 96 / dPageDpiX;
int nWidth = (nRasterW > 0) ? nRasterW : ((int)dWidth * 96 / dPageDpiX);
int nHeight = (nRasterH > 0) ? nRasterH : ((int)dHeight * 96 / dPageDpiX);
BYTE* pBgraData = new BYTE[nWidth * nHeight * 4];
if (!pBgraData)