本文整理汇总了C++中View::GetScaledPixelWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ View::GetScaledPixelWidth方法的具体用法?C++ View::GetScaledPixelWidth怎么用?C++ View::GetScaledPixelWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::GetScaledPixelWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialise
/********************************************************************************************
> virtual BOOL ConcurrentRenderer::Initialise(
GRenderRegion* pActiveRR,
double ResFactor,
DocRect AreaOfDocumentToRender,
UINT32 bpp,
BOOL NeedsTransp
)
Author: Ilan_Copelyn (Xara Group Ltd) <[email protected]>
Created: 5/06/2000
Purpose:
SeeAlso:
********************************************************************************************/
BOOL ConcurrentRenderer::Initialise(
GRenderRegion* pActiveRR,
double ResFactor,
DocRect AreaOfDocumentToRender,
UINT32 bpp,
BOOL NeedsTransp
)
{
// if we have no source render-region, then we need to manufacture a rendering matrix
// for ourself.
// to generate our render-matrix, we use the current view and spread, together with
// a user-specified dpi value.
Matrix SourceMat;
if (pActiveRR == NULL)
{
View* pView = View::GetCurrent();
if (pView == NULL)
return FALSE;
double PixelsPerInch = pView->GetConvertToEditableShapesDPI();
Spread* pSpread = Document::GetSelectedSpread();
if (pSpread == NULL)
return FALSE;
FIXED16 ViewPixelWidth = pView->GetScaledPixelWidth();
const double AppPixelWidth = MILLIPOINTS_PER_INCH / (double)PixelsPerInch;
double ViewScaleFactor = ViewPixelWidth.MakeDouble() / AppPixelWidth;
SourceMat = pView->ConstructScaledRenderingMatrix(pSpread, ViewScaleFactor);
}
// we have a source render-region, so get its matrix and scale up ResFactor
// so that our offscreen RR would effectively have the same scaled pixel width
// as its source render-region (not taking into account the original value of ResFactor).
else
{
SourceMat = pActiveRR->GetMatrix();
const double ActualPixelWidth = (double)pActiveRR->GetPixelWidth();
const double DefPixelWidth = MILLIPOINTS_PER_INCH / (double)GRenderRegion::GetDefaultDPI();
ResFactor *= DefPixelWidth / ActualPixelWidth;
}
// m_pView = pActiveRR->GetRenderView();
// m_pView = View::GetCurrent();
// if (m_pView)
// {
// TRACEUSER( "Gerry", _T("Forcing default context\n"));
// m_bOldForce = m_pView->SetForceDefaultColourContexts();
// }
m_pNewGD = new GDrawAsm;
if (m_pNewGD && m_pNewGD->Init())
{
// Save current device context
m_pOldGD = GRenderRegion::SetTempDrawContext(m_pNewGD);
// m_pOldGD = GRenderRegion::GetStaticDrawContext();
// GRenderRegion::GD = pGDAsm;
}
// Setup a new GRenderDIB (NB also initialises memory).
m_pNewRR = CreateGRenderDIB(ResFactor, AreaOfDocumentToRender, bpp, NeedsTransp, &SourceMat);
if (m_pNewRR != NULL)
{
return TRUE;
}
// If we get here then we have failed so clean up and return false
delete m_pNewGD;
m_pNewGD = NULL;
GRenderRegion::SetTempDrawContext(m_pOldGD);
m_pOldGD = NULL;
return FALSE;
}