本文整理汇总了C++中CFX_AffineMatrix::MatchRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_AffineMatrix::MatchRect方法的具体用法?C++ CFX_AffineMatrix::MatchRect怎么用?C++ CFX_AffineMatrix::MatchRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_AffineMatrix
的用法示例。
在下文中一共展示了CFX_AffineMatrix::MatchRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawControl
void CPDF_FormControl::DrawControl(CFX_RenderDevice* pDevice,
CFX_AffineMatrix* pMatrix,
CPDF_Page* pPage,
CPDF_Annot::AppearanceMode mode,
const CPDF_RenderOptions* pOptions) {
if (m_pWidgetDict->GetInteger("F") & ANNOTFLAG_HIDDEN) {
return;
}
CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pWidgetDict, mode);
if (pStream == NULL) {
return;
}
CFX_FloatRect form_bbox = pStream->GetDict()->GetRect("BBox");
CFX_AffineMatrix form_matrix = pStream->GetDict()->GetMatrix("Matrix");
form_matrix.TransformRect(form_bbox);
CFX_FloatRect arect = m_pWidgetDict->GetRect("Rect");
CFX_AffineMatrix matrix;
matrix.MatchRect(arect, form_bbox);
matrix.Concat(*pMatrix);
CPDF_Form form(m_pField->m_pForm->m_pDocument,
m_pField->m_pForm->m_pFormDict->GetDict("DR"), pStream);
form.ParseContent(NULL, NULL, NULL, NULL);
CPDF_RenderContext context;
context.Create(pPage);
context.DrawObjectList(pDevice, &form, &matrix, pOptions);
}
示例2: DrawPatternBitmap
static CFX_DIBitmap* DrawPatternBitmap(CPDF_Document* pDoc,
CPDF_PageRenderCache* pCache,
CPDF_TilingPattern* pPattern,
const CFX_AffineMatrix* pObject2Device,
int width,
int height,
int flags) {
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
if (!pBitmap->Create(width, height,
pPattern->m_bColored ? FXDIB_Argb : FXDIB_8bppMask)) {
delete pBitmap;
return NULL;
}
CFX_FxgeDevice bitmap_device;
bitmap_device.Attach(pBitmap);
pBitmap->Clear(0);
CFX_FloatRect cell_bbox = pPattern->m_BBox;
pPattern->m_Pattern2Form.TransformRect(cell_bbox);
pObject2Device->TransformRect(cell_bbox);
CFX_FloatRect bitmap_rect(0.0f, 0.0f, (FX_FLOAT)width, (FX_FLOAT)height);
CFX_AffineMatrix mtAdjust;
mtAdjust.MatchRect(bitmap_rect, cell_bbox);
CFX_AffineMatrix mtPattern2Bitmap = *pObject2Device;
mtPattern2Bitmap.Concat(mtAdjust);
CPDF_RenderOptions options;
if (!pPattern->m_bColored) {
options.m_ColorMode = RENDER_COLOR_ALPHA;
}
flags |= RENDER_FORCE_HALFTONE;
options.m_Flags = flags;
CPDF_RenderContext context;
context.Create(pDoc, pCache, NULL);
context.DrawObjectList(&bitmap_device, pPattern->m_pForm, &mtPattern2Bitmap,
&options);
return pBitmap;
}