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

.....

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62729 954022d7-b5bf-4e40-9824-e11837661b57
parent 05edf7ae
......@@ -510,8 +510,8 @@ namespace MetaFile
if (m_pOutput)
{
double dX, dY;
TranslatePoint(nX, nY, dX, dY);
double dX = nX, dY = nY;
//TranslatePoint(nX, nY, dX, dY);
double* pdDx = NULL;
if (pnDx)
......@@ -525,8 +525,8 @@ namespace MetaFile
for (unsigned int unCharIndex = 0; unCharIndex < unCharsCount; unCharIndex++)
{
int nX1 = nCurX + pnDx[unCharIndex];
double dX1, dY1;
TranslatePoint(nX1, nY, dX1, dY1);
double dX1 = nX1, dY1 = nY;
//TranslatePoint(nX1, nY, dX1, dY1);
pdDx[unCharIndex] = dX1 - dCurX;
nCurX = nX1;
dCurX = dX1;
......
......@@ -177,6 +177,8 @@ namespace MetaFile
{
double dX, dY, dW, dH;
GetBounds(&dX, &dY, &dW, &dH);
if (nWidth < 0) nWidth = dW;
nHeight = (int)((double)nWidth * dH / dW);
}
......
......@@ -116,11 +116,12 @@ void CSvmFile::PlayMetaFile()
case META_TEXT_ACTION: Read_META_TEXT(); break;
case META_TEXTARRAY_ACTION: Read_META_ARRAYTEXT(); break;
case META_MAPMODE_ACTION: Read_META_SETMAPMODE(); break;
case META_FONT_ACTION: Read_META_CREATEFONT(); break;
case META_FONT_ACTION: Read_META_FONT(); break;
case META_BMPSCALE_ACTION: Read_META_BMPSCALE(); break;
case META_LINECOLOR_ACTION: Read_META_SETLINECOLOR(); break;
case META_FILLCOLOR_ACTION: Read_META_SETFILLCOLOR(); break;
case META_TEXTFILLCOLOR_ACTION:
case META_TEXTCOLOR_ACTION: Read_META_SETTEXTCOLOR(); break;
case META_GRADIENT_ACTION: Read_META_GRADIENT(); break;
case META_GRADIENTEX_ACTION: Read_META_GRADIENTEX(); break;
......@@ -130,6 +131,8 @@ void CSvmFile::PlayMetaFile()
case META_PUSH_ACTION: Read_META_PUSH(); break;
case META_POP_ACTION: Read_META_POP(); break;
case META_TRANSPARENT_ACTION: Read_META_TRANSPARENT(); break;
case META_ROUNDRECT_ACTION:
case META_ELLIPSE_ACTION:
case META_ARC_ACTION:
......@@ -154,9 +157,7 @@ void CSvmFile::PlayMetaFile()
case META_ISECTRECTCLIPREGION_ACTION:
case META_ISECTREGIONCLIPREGION_ACTION:
case META_MOVECLIPREGION_ACTION:
case META_TEXTFILLCOLOR_ACTION:
case META_TEXTALIGN_ACTION:
case META_TRANSPARENT_ACTION:
case META_EPS_ACTION:
case META_REFPOINT_ACTION:
case META_TEXTLINECOLOR_ACTION:
......@@ -215,6 +216,23 @@ void CSvmFile::Read_META_RECTANGLE()
void CSvmFile::Read_SVM_HEADER()
{
m_oStream >> m_oHeader;
//m_pDC->SetWindowExt ( m_oHeader.boundRect.nRight - m_oHeader.boundRect.nLeft,
// m_oHeader.boundRect.nBottom - m_oHeader.boundRect.nTop);
//m_pDC->SetWindowScale( (double)m_oHeader.mapMode.scaleX.numerator/m_oHeader.mapMode.scaleX.denominator,
// (double)m_oHeader.mapMode.scaleY.numerator/m_oHeader.mapMode.scaleY.denominator);
//
//if (m_pOutput)
//{
// TRect oRect = m_oHeader.boundRect;// GetBoundingBox();
// m_pDC->SetWindowOff(oRect.nLeft, oRect.nTop);
// m_pDC->SetWindowExt(oRect.nRight - oRect.nLeft, oRect.nBottom - oRect.nTop);
//}
//else
{
m_bFirstPoint = true;
}
}
void CSvmFile::Read_META_POLYLINE()
{
......@@ -273,10 +291,8 @@ void CSvmFile::Read_META_POLYGON()
DrawPath(true, true);
}
void CSvmFile::Read_META_POLYPOLYGON()
void CSvmFile::Read_META_POLYPOLYGON(std::vector<TSvmPolygon> & polygons)
{
std::vector<TSvmPolygon> polygons;
unsigned short ushNumberOfPolygons;
m_oStream >> ushNumberOfPolygons;
if (ushNumberOfPolygons <= 0)
......@@ -307,10 +323,15 @@ void CSvmFile::Read_META_POLYPOLYGON()
m_oStream >> complexPolygons[complexPolygonIndex];
}
}
}
void CSvmFile::Read_META_POLYPOLYGON()
{
std::vector<TSvmPolygon> polygons;
Read_META_POLYPOLYGON(polygons);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
for (unsigned short ushPolygonIndex = 0; ushPolygonIndex < ushNumberOfPolygons; ushPolygonIndex++)
for (unsigned short ushPolygonIndex = 0; ushPolygonIndex < polygons.size(); ushPolygonIndex++)
{
unsigned short ushPointsCount = polygons[ushPolygonIndex].count;
......@@ -480,36 +501,8 @@ void CSvmFile::Read_META_SETLINECOLOR()
void CSvmFile::Read_META_GRADIENTEX()
{
std::vector<TSvmPolygon> polygons;
Read_META_POLYPOLYGON(polygons);
unsigned short ushNumberOfPolygons;
m_oStream >> ushNumberOfPolygons;
for (unsigned short ushIndex = 0; ushIndex < ushNumberOfPolygons; ushIndex++)
{
TSvmPolygon poligon;
m_oStream >> poligon;
polygons.push_back(poligon);
}
std::vector<TSvmPolygon> complexPolygons;
if (m_currentActionVersion > 1)
{
unsigned short complexPolygonCount;
m_oStream >> complexPolygonCount;
complexPolygons.resize(complexPolygonCount);
for (unsigned short i = 0; i < complexPolygonCount; i++)
{
unsigned short complexPolygonIndex;
m_oStream >> complexPolygonIndex;
m_oStream >> complexPolygons[complexPolygonIndex];
}
}
//////////////////////////////////////////////////////////////
CSvmBrush* pBrush = new CSvmBrush();
if (!pBrush)
return SetError();
......@@ -534,6 +527,60 @@ void CSvmFile::Read_META_GRADIENTEX()
m_oPlayer.RegisterObject((CSvmObjectBase*)pBrush);
}
void CSvmFile::Read_META_TRANSPARENT()
{
std::vector<TSvmPolygon> polygons;
Read_META_POLYPOLYGON(polygons);
unsigned short nPercent;
m_oStream >> nPercent;
if (m_pOutput)
{
CSvmBrush *last_brush = dynamic_cast<CSvmBrush *>(m_oPlayer.GetLastObject(SVM_OBJECT_BRUSH));
CSvmBrush* pBrush = new CSvmBrush();
pBrush->BrushStyle = BS_NULL;
if (!pBrush)
return SetError();
if (last_brush)
{
pBrush->BrushStyle = last_brush->BrushStyle;
pBrush->BrushHatch = last_brush->BrushHatch;
pBrush->BrushStyleEx = last_brush->BrushStyleEx;
pBrush->BrushBounds = last_brush->BrushBounds;
pBrush->Color = last_brush->Color;
pBrush->Color2 = last_brush->Color2;
pBrush->Color.a = 0xff * nPercent /100;
pBrush->Color2.a = 0xff * nPercent /100;
}
m_oPlayer.RegisterObject((CSvmObjectBase*)pBrush);
m_pOutput->StartPath();
for (unsigned short ushPolygonIndex = 0; ushPolygonIndex < polygons.size(); ushPolygonIndex++)
{
unsigned short ushPointsCount = polygons[ushPolygonIndex].count;
if (ushPointsCount <= 0)
continue;
MoveTo(polygons[ushPolygonIndex].points[0].x, polygons[ushPolygonIndex].points[0].y);
for (int i = 1; i < ushPointsCount; i++)
{
LineTo(polygons[ushPolygonIndex].points[i].x, polygons[ushPolygonIndex].points[i].y);
}
m_pOutput->ClosePath();
}
}
DrawPath(false, true);
}
void CSvmFile::Read_META_GRADIENT()
{
CSvmBrush* pBrush = new CSvmBrush();
......@@ -562,7 +609,7 @@ void CSvmFile::Read_META_GRADIENT()
}
void CSvmFile::Read_META_CREATEFONT()
void CSvmFile::Read_META_FONT()
{
CSvmFont* pFont = new CSvmFont();
if (!pFont)
......@@ -570,8 +617,10 @@ void CSvmFile::Read_META_CREATEFONT()
m_oStream >> pFont;
m_currentCharset = pFont->CharSet;
m_oPlayer.RegisterObject((CSvmObjectBase*)pFont);
}
#define COMPRESS_OWN ('S'|('D'<<8))
#define COMPRESS_NONE ( 0 )
#define RLE_8 ( 1 )
......@@ -713,7 +762,7 @@ void CSvmFile::Read_META_BMPSCALE()
// bufBGRA[j+2] = destBuf[i+2];
// bufBGRA[j+3] = 0xff;
//}
double dX, dY, dX1, dY1;
double dX = point.x, dY = point.y, dX1 = point.x + size.cx, dY1 =point.y + size.cy;
TranslatePoint(point.x, point.y, dX, dY);
TranslatePoint(point.x + size.cx, point.y + size.cy, dX1, dY1);
......
......@@ -36,7 +36,7 @@ class CSvmFile : virtual public IMetaFileBase
}
TRect* GetBounds()
{
return &m_oHeader.boundRect;
return &m_oHeader.boundRect;//&m_oBoundingBox;//
}
TRect* GetDCBounds()
{
......@@ -53,7 +53,7 @@ class CSvmFile : virtual public IMetaFileBase
int GetTextColor()
{
TSvmColor& oColor = m_pDC->GetTextColor();
return oColor.color; //METAFILE_RGBA(oColor.r, oColor.g, oColor.b);
return METAFILE_RGBA(oColor.r, oColor.g, oColor.b);
}
IFont* GetFont()
{
......@@ -99,7 +99,7 @@ class CSvmFile : virtual public IMetaFileBase
TPointD GetCurPos()
{
TSvmPoint oPoint = m_pDC->GetCurPos();
TPointD oRes;
TPointD oRes( oPoint.x, oPoint.y);
TranslatePoint(oPoint.x, oPoint.y, oRes.x, oRes.y);
return oRes;
}
......@@ -161,39 +161,20 @@ class CSvmFile : virtual public IMetaFileBase
void Read_META_SETTEXTCOLOR();
void Read_META_SETFILLCOLOR();
void Read_META_SETLINECOLOR();
void Read_META_CREATEFONT();
void Read_META_FONT();
void Read_META_BMPSCALE();
void Read_META_RASTEROP();
void Read_META_PUSH();
void Read_META_POP();
void Read_META_GRADIENT();
void Read_META_GRADIENTEX();
void Read_META_TRANSPARENT();
void Read_META_POLYPOLYGON(std::vector<TSvmPolygon> & polygons);
void RegisterPoint(short shX, short shY)
{
if (m_bFirstPoint)
{
m_oBoundingBox.nLeft = shX;
m_oBoundingBox.nRight = shX;
m_oBoundingBox.nTop = shY;
m_oBoundingBox.nBottom = shY;
m_bFirstPoint = false;
}
else
{
if (shX < m_oBoundingBox.nLeft)
m_oBoundingBox.nLeft = shX;
else if (shX > m_oBoundingBox.nRight)
m_oBoundingBox.nRight = shX;
if (shY < m_oBoundingBox.nTop)
m_oBoundingBox.nTop = shY;
else if (shY > m_oBoundingBox.nBottom)
m_oBoundingBox.nBottom = shY;
}
}
void TranslatePoint(TEmfPointL& oPoint, double& dX, double& dY)
//-------------------------------------------------------------------------------------------------------
void TranslatePoint(TSvmPoint& oPoint, double& dX, double& dY)
{
TranslatePoint(oPoint.x, oPoint.y, dX, dY);
}
......@@ -257,9 +238,11 @@ class CSvmFile : virtual public IMetaFileBase
{
if (m_pOutput)
{
double dX, dY, dR, dB;
double dX=nX, dY=nY, dR=nX+nW, dB=nY+nH;
TranslatePoint(nX, nY, dX, dY);
TranslatePoint(nX + nW, nY + nH, dR, dB);
m_pOutput->DrawBitmap(dX, dY, dR - dX, dB - dY, pImageBuffer, unImageW, unImageH);
}
}
......@@ -273,7 +256,7 @@ class CSvmFile : virtual public IMetaFileBase
{
//ProcessRasterOperation(unRasterOperation, &pBgra, unWidth, unHeight);
double dX, dY, dX1, dY1;
double dX=nX, dY=nY, dX1=nX+nW, dY1=nY+nH;
TranslatePoint(nX, nY, dX, dY);
TranslatePoint(nX + nW, nY + nH, dX1, dY1);
......@@ -293,17 +276,14 @@ class CSvmFile : virtual public IMetaFileBase
RegisterPoint(nX + nW, nY + nH);
}
}
void MoveTo(TEmfPointL& oPoint)
{
MoveTo(oPoint.x, oPoint.y);
}
void MoveTo(TEmfPointS& oPoint)
void MoveTo(TSvmPoint& oPoint)
{
MoveTo(oPoint.x, oPoint.y);
}
void MoveTo(int nX, int nY)
{
double dX, dY;
double dX = nX, dY = nY;
TranslatePoint(nX, nY, dX, dY);
//if (m_pPath)
......@@ -321,8 +301,9 @@ class CSvmFile : virtual public IMetaFileBase
}
void LineTo(int nX, int nY)
{
double dX, dY;
double dX = nX, dY = nY;
TranslatePoint(nX, nY, dX, dY);
//RegisterPoint(nX, nY);
//if (m_pPath)
//{
......@@ -361,11 +342,7 @@ class CSvmFile : virtual public IMetaFileBase
m_pDC->SetCurPos(nXe, nYe);
}
void CurveTo(TEmfPointS& oPoint1, TEmfPointS& oPoint2, TEmfPointS& oPointE)
{
CurveTo(oPoint1.x, oPoint1.y, oPoint2.x, oPoint2.y, oPointE.x, oPointE.y);
}
void CurveTo(TEmfPointL& oPoint1, TEmfPointL& oPoint2, TEmfPointL& oPointE)
void CurveTo(TSvmPoint& oPoint1, TSvmPoint& oPoint2, TSvmPoint& oPointE)
{
CurveTo(oPoint1.x, oPoint1.y, oPoint2.x, oPoint2.y, oPointE.x, oPointE.y);
}
......@@ -430,7 +407,7 @@ class CSvmFile : virtual public IMetaFileBase
if (m_pOutput)
{
double dX, dY;
double dX = nX, dY = nY;
TranslatePoint(nX, nY, dX, dY);
double* pdDx = NULL;
......@@ -445,7 +422,7 @@ class CSvmFile : virtual public IMetaFileBase
for (unsigned int unCharIndex = 0; unCharIndex < unCharsCount; unCharIndex++)
{
int nX1 = nCurX + pnDx[unCharIndex];
double dX1, dY1;
double dX1 = nX1, dY1;
TranslatePoint(nX1, nY, dX1, dY1);
pdDx[unCharIndex] = dX1 - dCurX;
nCurX = nX1;
......@@ -460,115 +437,41 @@ class CSvmFile : virtual public IMetaFileBase
delete[] pdDx;
}
}
//void DrawTextA(TEmfEmrText& oText)
//{
// if (!oText.OutputString)
// return SetError();
TRect GetBoundingBox()
{
TRect oBB = m_oBoundingBox;
// IFont* pFont = GetFont();
// NSString::CConverter::ESingleByteEncoding eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_DEFAULT;
// if (pFont)
// {
// // Charset -> Codepage: http://support.microsoft.com/kb/165478
// // http://msdn.microsoft.com/en-us/library/cc194829.aspx
// // Charset Name Charset Value(hex) Codepage number
// // ------------------------------------------------------
// //
// // DEFAULT_CHARSET 1 (x01)
// // SYMBOL_CHARSET 2 (x02)
// // OEM_CHARSET 255 (xFF)
// // ANSI_CHARSET 0 (x00) 1252
// // RUSSIAN_CHARSET 204 (xCC) 1251
// // EASTEUROPE_CHARSET 238 (xEE) 1250
// // GREEK_CHARSET 161 (xA1) 1253
// // TURKISH_CHARSET 162 (xA2) 1254
// // BALTIC_CHARSET 186 (xBA) 1257
// // HEBREW_CHARSET 177 (xB1) 1255
// // ARABIC _CHARSET 178 (xB2) 1256
// // SHIFTJIS_CHARSET 128 (x80) 932
// // HANGEUL_CHARSET 129 (x81) 949
// // GB2313_CHARSET 134 (x86) 936
// // CHINESEBIG5_CHARSET 136 (x88) 950
// // THAI_CHARSET 222 (xDE) 874
// // JOHAB_CHARSET 130 (x82) 1361
// // VIETNAMESE_CHARSET 163 (xA3) 1258
// switch (pFont->GetCharSet())
// {
// default:
// case DEFAULT_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_DEFAULT; break;
// case SYMBOL_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_DEFAULT; break;
// case ANSI_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1252; break;
// case RUSSIAN_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1251; break;
// case EASTEUROPE_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1250; break;
// case GREEK_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1253; break;
// case TURKISH_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1254; break;
// case BALTIC_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1257; break;
// case HEBREW_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1255; break;
// case ARABIC_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1256; break;
// case SHIFTJIS_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP932; break;
// case HANGEUL_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP949; break;
// case 134/*GB2313_CHARSET*/: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP936; break;
// case CHINESEBIG5_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP950; break;
// case THAI_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP874; break;
// case JOHAB_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1361; break;
// case VIETNAMESE_CHARSET: eCharSet = NSString::CConverter::ESingleByteEncoding::SINGLE_BYTE_ENCODING_CP1258; break;
// }
// }
// std::wstring wsText = NSString::CConverter::GetUnicodeFromSingleByteString((unsigned char*)oText.OutputString, oText.Chars, eCharSet);
// int* pDx = NULL;
// if (oText.OutputDx)
// {
// pDx = new int[oText.Chars];
// if (pDx)
// {
// for (unsigned int unIndex = 0; unIndex < oText.Chars; unIndex++)
// {
// pDx[unIndex] = oText.OutputDx[unIndex];
// // Y
// if (oText.Options & ETO_PDY)
// unIndex++;
// }
// }
// }
// DrawText(wsText, oText.Chars, oText.Reference.x, oText.Reference.y, pDx);
// if (pDx)
// delete[] pDx;
//}
//void DrawTextW(TEmfEmrText& oText)
//{
// if (!oText.OutputString)
// return SetError();
if (abs(oBB.nRight - oBB.nLeft) <= 1)
oBB.nRight = oBB.nLeft + 1024;
// std::wstring wsText = NSString::CConverter::GetUnicodeFromUTF16((unsigned short*)oText.OutputString, oText.Chars);
// int* pDx = NULL;
// if (oText.OutputDx)
// {
// pDx = new int[oText.Chars];
// if (pDx)
// {
// for (unsigned int unIndex = 0; unIndex < oText.Chars; unIndex++)
// {
// pDx[unIndex] = oText.OutputDx[unIndex];
// // Y
// if (oText.Options & ETO_PDY)
// unIndex++;
// }
// }
// }
// DrawText(wsText, oText.Chars, oText.Reference.x, oText.Reference.y, pDx);
// if (pDx)
// delete[] pDx;
//}
if (abs(oBB.nBottom - oBB.nTop) <= 1)
oBB.nBottom = m_oBoundingBox.nTop + 1024;
return oBB;
}
void RegisterPoint(short shX, short shY)
{
if (m_bFirstPoint)
{
m_oBoundingBox.nLeft = shX;
m_oBoundingBox.nRight = shX;
m_oBoundingBox.nTop = shY;
m_oBoundingBox.nBottom = shY;
m_bFirstPoint = false;
}
else
{
if (shX < m_oBoundingBox.nLeft)
m_oBoundingBox.nLeft = shX;
else if (shX > m_oBoundingBox.nRight)
m_oBoundingBox.nRight = shX;
if (shY < m_oBoundingBox.nTop)
m_oBoundingBox.nTop = shY;
else if (shY > m_oBoundingBox.nBottom)
m_oBoundingBox.nBottom = shY;
}
}
};
......
......@@ -176,11 +176,11 @@ CSvmBrush::CSvmBrush(CSvmBrush& oBrush)
int CSvmBrush::GetColor()
{
return Color.color;//METAFILE_RGBA(Color.r, Color.g, Color.b);
return METAFILE_RGBA(Color.r, Color.g, Color.b);
}
int CSvmBrush::GetColor2()
{
return Color2.color;//METAFILE_RGBA(Color2.r, Color2.g, Color2.b);
return METAFILE_RGBA(Color2.r, Color2.g, Color2.b);
}
unsigned int CSvmBrush::GetStyleEx()
{
......@@ -207,7 +207,7 @@ void CSvmBrush::GetBounds(double& left, double& top, double& width, double& heig
}
int CSvmPen::GetColor()
{
return Color.color;//METAFILE_RGBA(Color.r, Color.g, Color.b);
return METAFILE_RGBA(Color.r, Color.g, Color.b);
}
TSvmRect::TSvmRect(CDataStream &stream)
{
......@@ -246,23 +246,11 @@ CDataStream& operator>>(CDataStream &stream, TSvmColor &c)
char s;
unsigned short a, r, g, b, p;
//stream >> s;
// stream >> a;
// stream >> r;
// stream >> g;
// stream >> b;
// stream >> p;
stream >> c.b;
stream >> c.g;
stream >> c.r;
stream >> c.a;
//c.a = a;
//c.r = r;
//c.b = b;
//c.g = g;
c.color = METAFILE_RGBA(c.r, c.g, c.b, c.a);
return stream;
......
......@@ -671,17 +671,7 @@ TSvmWindow* CSvmDC::GetViewport()
}
bool CSvmDC::UpdatePixelMetrics()
{
unsigned int ulMapMode = m_ulMapMode;
if (MM_ISOTROPIC == ulMapMode)
{
if (0 == m_oWindow.ulW || 0 == m_oViewport.ulW)
return false;
double dPixel = (double)m_oViewport.ulW / (double)m_oWindow.ulW;
SetPixelHeight(dPixel);
SetPixelWidth(dPixel);
}
else if (MM_ANISOTROPIC == ulMapMode)
if (m_ulMapMode == MAP_RELATIVE)
{
double dPixelX = (double)m_oViewport.ulW / (double)m_oWindow.ulW;
double dPixelY = (double)m_oViewport.ulH / (double)m_oWindow.ulH;
......
......@@ -112,14 +112,31 @@ public:
void SetArcDirection(unsigned int unDirection);
unsigned int GetArcDirection();
void SetWindowOff(short shX, short shY)
{
m_oWindow.lX += shX;
m_oWindow.lY += shY;
UpdatePixelMetrics();
}
void SetWindowScale(double dX, double dY)
{
m_oWindow.ulW = (int)(m_oWindow.ulW * dX);
m_oWindow.ulH = (int)(m_oWindow.ulH * dY);
UpdatePixelMetrics();
}
void SetWindowExt(short shW, short shH)
{
m_oWindow.ulW = shW;
m_oWindow.ulH = shH;
UpdatePixelMetrics();
}
private:
void SetPixelWidth(double dPixelW);
void SetPixelHeight(double dPixelH);
bool UpdatePixelMetrics();
private:
ESvmMapUnit m_ulMapMode;
CSvmBrush* m_pBrush;
CSvmPen* m_pPen;
......
......@@ -62,7 +62,7 @@ void ConvertFolder(CMetaFile &oMetaFile, std::wstring wsFolderPath, const int nT
if (oMetaFile.LoadFromFile(wsFilePath.c_str()))
{
std::wstring wsDstFilePath = (wsFilePath.substr(0, wsFilePath.size() - 3)).append(L"bmp");
oMetaFile.ConvertToRaster(wsDstFilePath.c_str(), 1, 1000);
oMetaFile.ConvertToRaster(wsDstFilePath.c_str(), 1, 1980);
oMetaFile.Close();
}
......
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