本文整理汇总了C++中Path::Scale方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::Scale方法的具体用法?C++ Path::Scale怎么用?C++ Path::Scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::Scale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddPathToImagemap
void ImagemapRenderRegion::AddPathToImagemap(Path* ppthToAdd, WebAddressAttribute* pwaaCurrent)
{
//First get the origin of the export area and the DPI
DocCoord dcOrigin=ImagemapFilterOptions::GetOriginOfExportArea(m_Options.m_stExportArea);
double dDPI=m_Options.m_dDPI;
//Now, how many subpaths are there in this path?
INT32 lNumSubpaths=ppthToAdd->GetNumSubpaths();
//For each subpath in the path
for (INT32 l=0; l<lNumSubpaths; l++)
{
//Create a new path
Path pthSubpath;
pthSubpath.Initialise(ppthToAdd->GetNumCoords());
//And copy the next subpath into it
ppthToAdd->MakePathFromSubPath(l, &pthSubpath);
//Now, if that subpath is closed
if (pthSubpath.IsSubPathClosed(0))
{
//Then we want to add it to the imagemap
//So scale it to dDPI and by dcOrigin
pthSubpath.Scale(dcOrigin, dDPI);
//Now we need to flatten it.
//This means creating a new path, because otherwise Path::Flatten
//goes wrong
Path pthFlattened;
pthFlattened.Initialise(pthSubpath.GetNumCoords());
//So, if we should flatten the path
if (m_Options.m_ffApprox!=FF_NOTATALL)
//Then do it
pthSubpath.Flatten(m_Options.m_ffApprox, &pthFlattened);
else
//Otherwise, simply copy the path across
pthFlattened.CopyPathDataFrom(&pthSubpath);
//Then add the flattened path to the imagemap
m_Imagemap.AddPolygon(&pthFlattened, pwaaCurrent->m_url.GetWebAddress(), pwaaCurrent->m_pcFrame);
}
}
}
示例2: AddCircleToImagemap
void ImagemapRenderRegion::AddCircleToImagemap(Path* ppthToScale, WebAddressAttribute* pwaaCurrent)
{
//First get the origin of the export area and the DPI
DocCoord dcOrigin=ImagemapFilterOptions::GetOriginOfExportArea(m_Options.m_stExportArea);
double dDPI=m_Options.m_dDPI;
//Now make a copy of the path
Path pthToAdd;
pthToAdd.Initialise(ppthToScale->GetNumCoords());
pthToAdd.CopyPathDataFrom(ppthToScale);
//Scale it
pthToAdd.Scale(dcOrigin, dDPI);
//And add it to the imagemap
m_Imagemap.AddCircle(&pthToAdd, pwaaCurrent->m_url.GetWebAddress(), pwaaCurrent->m_pcFrame);
}