本文整理汇总了C++中View::GetPrintControl方法的典型用法代码示例。如果您正苦于以下问题:C++ View::GetPrintControl方法的具体用法?C++ View::GetPrintControl怎么用?C++ View::GetPrintControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::GetPrintControl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteSepFunctions
BOOL PrintPSRenderRegion::WriteSepFunctions(KernelDC *pDC)
{
PrintControl *pPrintCtl=NULL;
View *pView = GetRenderView();
if (pView) pPrintCtl = pView->GetPrintControl();
if (!pPrintCtl)
return TRUE;
// Get a pointer to the typeset info structure
TypesetInfo *pInfo = pPrintCtl->GetTypesetInfo();
// Is screening off?
if (!pInfo->AreScreening())
return TRUE;
// Get hold of our PostScript prolog resource...
CCResTextFile ScreenFile;
// Open the file
if (!ScreenFile.open(_R(IDM_PS_SPOTFUNCS), _R(IDT_PS_RES)))
{
// Failed to open the file...
ERROR2(FALSE, "Could not get at PostScript resource!");
}
// Read each line from the file and output it to the DC.
String_256 LineBuf;
TCHAR *pBuf = (TCHAR *) LineBuf;
while (!ScreenFile.eof())
{
// Copy this line to output.
ScreenFile.read(&LineBuf);
pDC->OutputTCHARAsChar(pBuf, LineBuf.Length());
pDC->OutputNewLine();
}
// All done
ScreenFile.close();
return TRUE;
}
示例2: ProcessPath
//.........这里部分代码省略.........
// Don't bother drawing anything - it's clipped out
return;
}
ClipRegion = ClipRegion.Intersection(PathRect);
// Round the ClipRegion edges up so they all lie exactly on screen pixel boundaries.
// If we don't do this, then there can be a sub-pixel rounding error between the ClipRegion
// and the actual bitmap size, so that the bitmap is scaled slightly when we plot it.
// By making sure it's pixelised, we guarantee that the bitmap & clipregion are exactly equal sizes.
// (It doesn't matter if the bitmap is a bit bigger than necessary)
ClipRegion.Inflate(pRender->GetScaledPixelWidth());
ClipRegion.lo.Pixelise(pView);
ClipRegion.hi.Pixelise(pView);
// Get the current view's rendering matrix and view scale
Matrix ConvMatrix = pRender->GetMatrix();//pView->ConstructRenderingMatrix(pSpread);
FIXED16 ViewScale = pView->GetViewScale();
// Generate a 256-colour greyscale palette
LOGPALETTE *pPalette = MakeGreyScalePalette();
if(pPalette == NULL)
{
pRender->DrawPath(pPath, this, ShapePath);
return;
}
// Work out the DPI to use. Rather than just asking for PixelWidth or DPI from the
// render region, we have to do a load of non-object-oriented stuff instead...
double dpi = 96.0;
if (pRender->IsPrinting())
{
// we are printing, so ask the print options
PrintControl *pPrintControl = pView->GetPrintControl();
if (pPrintControl != NULL)
dpi = (double) pPrintControl->GetDotsPerInch();
}
else if (IS_A(pRender, CamelotEPSRenderRegion))
{
// Use DPI as set in EPS export options dialog.
dpi = (double) EPSFilter::XSEPSExportDPI;
}
else
{
ERROR3IF(pRender->GetPixelWidth() <= 0, "Stupid (<1 millipoint) Pixel Width!");
if (pRender->GetPixelWidth() > 0)
dpi = (double) (72000.0 / (double)pRender->GetPixelWidth());
}
GRenderBitmap *pMaskRegion = new GRenderBitmap(ClipRegion, ConvMatrix, ViewScale, 8, dpi,
pRender->IsPrinting(), XARADITHER_ORDERED_GREY,
pPalette, FALSE);
if (pMaskRegion == NULL)
{
pRender->DrawPath(pPath, this, ShapePath);
return;
}
BOOL PathIsFilled = FALSE; // Will be set TRUE if this path should be filled at the bottom of the function
//BLOCK
{
// Change the GDraw context in this render region so as to preserve the state
// of the main render region. This is because GRenderRegions currently use
// a single static GDrawContext! This also sets it up with a nice greyscale palette
// so that we get the output we desire.
示例3: WritePlateScreen
BOOL PrintPSRenderRegion::WritePlateScreen(KernelDC *pDC)
{
PrintControl *pPrintCtl=NULL;
View *pView = GetRenderView();
if (pView) pPrintCtl = pView->GetPrintControl();
if (!pPrintCtl)
return TRUE;
// Get a pointer to the typeset info structure
TypesetInfo *pInfo = pPrintCtl->GetTypesetInfo();
double ang,freq;
String_256 ScreenName;
ScreenType scrtype;
// If separating then interogate the current plate
if (pInfo->AreSeparating())
{
ColourPlate* pSeparation;
GetOutputColourPlate(COLOURMODEL_CMYK, NULL, &pSeparation);
// do nothing if we are not separating
if (pSeparation==NULL)
return TRUE;
// Make sure screening is on in this plate
if (!pSeparation->ActiveScreening())
return TRUE;
// Get the screen type if enabled.
scrtype = pSeparation->GetScreenFunction();
if (scrtype==SCRTYPE_NONE)
return TRUE;
// ok we can get the angle and frequency
ang = pSeparation->GetScreenAngle();
freq = pSeparation->GetScreenFrequency();
}
else
{
// Is screening off?
if (!pInfo->AreScreening())
return TRUE;
scrtype = pInfo->GetScreenFunction();
if (scrtype==SCRTYPE_NONE)
return TRUE;
ang = 45.0;
freq = pInfo->GetDefaultScreenFrequency();
}
// read the name of this screen
pInfo->GetScreenName(scrtype, &ScreenName);
String_256 fred;
fred += String_8(_T("{"));
fred += ScreenName;
fred += String_8(_T("}"));
// ok output 'freq ang screenfunc setscreen'
BOOL ok = pDC->OutputFloat(freq, 4);
ok = ok && pDC->OutputFloat(ang, 4);
ok = ok && pDC->OutputToken(fred);
ok = ok && pDC->OutputToken(_T("setscreen"));
ok = ok && pDC->OutputNewLine();
return ok;
}