本文整理汇总了C++中CFX_PathData::SetPointCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_PathData::SetPointCount方法的具体用法?C++ CFX_PathData::SetPointCount怎么用?C++ CFX_PathData::SetPointCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_PathData
的用法示例。
在下文中一共展示了CFX_PathData::SetPointCount方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawThisAppearance
void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) {
if (IsVisible() && m_bFlash) {
CFX_FloatRect rcRect = GetCaretRect();
CFX_FloatRect rcClip = GetClipRect();
CFX_PathData path;
path.SetPointCount(2);
FX_FLOAT fCaretX = rcRect.left + m_fWidth * 0.5f;
FX_FLOAT fCaretTop = rcRect.top;
FX_FLOAT fCaretBottom = rcRect.bottom;
if (!rcClip.IsEmpty()) {
rcRect.Intersect(rcClip);
if (!rcRect.IsEmpty()) {
fCaretTop = rcRect.top;
fCaretBottom = rcRect.bottom;
path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
} else {
return;
}
} else {
path.SetPoint(0, fCaretX, fCaretBottom, FXPT_MOVETO);
path.SetPoint(1, fCaretX, fCaretTop, FXPT_LINETO);
}
CFX_GraphStateData gsd;
gsd.m_LineWidth = m_fWidth;
pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255, 0, 0, 0),
FXFILL_ALTERNATE);
}
}
示例2: DrawThisAppearance
void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device)
{
CPWL_Button::DrawThisAppearance(pDevice, pUser2Device);
CPDF_Rect rcClient = this->GetClientRect();
rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f);
CFX_GraphStateData gsd;
gsd.m_LineWidth = 1.0f;
CFX_PathData pathCross;
if (m_bMouseDown)
{
rcClient.left += 0.5f;
rcClient.right += 0.5f;
rcClient.top -= 0.5f;
rcClient.bottom -= 0.5f;
}
pathCross.SetPointCount(4);
pathCross.SetPoint(0, rcClient.left, rcClient.bottom, FXPT_MOVETO);
pathCross.SetPoint(1, rcClient.right, rcClient.top, FXPT_LINETO);
pathCross.SetPoint(2, rcClient.left, rcClient.top, FXPT_MOVETO);
pathCross.SetPoint(3, rcClient.right, rcClient.bottom, FXPT_LINETO);
pDevice->DrawPath(&pathCross, pUser2Device, &gsd,
0, CPWL_Utils::PWLColorToFXColor(GetTextColor(),this->GetTransparency()), FXFILL_ALTERNATE);
}
示例3: DrawThisAppearance
void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
CPDF_Matrix* pUser2Device) {
CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect();
if (IsVisible() && !rectWnd.IsEmpty()) {
CPDF_Point ptCenter = GetCenterPoint();
CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN,
ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN,
ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
CPDF_Point pt3(ptCenter.x,
ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f);
if (IsFloatBigger(rectWnd.right - rectWnd.left,
PWL_CBBUTTON_TRIANGLE_HALFLEN * 2) &&
IsFloatBigger(rectWnd.top - rectWnd.bottom,
PWL_CBBUTTON_TRIANGLE_HALFLEN)) {
CFX_PathData path;
path.SetPointCount(4);
path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
pDevice->DrawPath(&path, pUser2Device, NULL,
CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,
GetTransparency()),
0, FXFILL_ALTERNATE);
}
}
}
示例4: OnDraw
void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
/*HDC hDC,*/ CPDFSDK_Annot* pAnnot,
CFX_RenderDevice* pDevice,
CPDF_Matrix* pUser2Device,
/*const CRect& rcWindow,*/ FX_DWORD dwFlags) {
ASSERT(pPageView != NULL);
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
if (IsVisible(pWidget)) {
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
if (pFormFiller->IsValid()) {
pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
pAnnot->GetPDFPage();
CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
if (pDocument->GetFocusAnnot() == pAnnot) {
CPDF_Rect rcFocus = pFormFiller->GetFocusBox(pPageView);
if (!rcFocus.IsEmpty()) {
CFX_PathData path;
path.SetPointCount(5);
path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO);
path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO);
path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO);
path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO);
path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO);
CFX_GraphStateData gsd;
gsd.SetDashCount(1);
gsd.m_DashArray[0] = 1.0f;
gsd.m_DashPhase = 0;
gsd.m_LineWidth = 1.0f;
pDevice->DrawPath(&path, pUser2Device, &gsd, 0,
ArgbEncode(255, 0, 0, 0), FXFILL_ALTERNATE);
}
}
return;
}
}
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device,
dwFlags);
else
pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget))
pWidget->DrawShadow(pDevice, pPageView);
}
}
示例5: AddPathObject
void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke) {
int PathPointCount = m_PathPointCount, PathClipType = m_PathClipType;
m_PathPointCount = 0;
m_PathClipType = 0;
if (PathPointCount <= 1) {
if (PathPointCount && PathClipType) {
CPDF_Path path;
path.New()->AppendRect(0, 0, 0, 0);
m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, TRUE);
}
return;
}
if (PathPointCount &&
m_pPathPoints[PathPointCount - 1].m_Flag == FXPT_MOVETO) {
PathPointCount--;
}
CPDF_Path Path;
CFX_PathData* pPathData = Path.New();
pPathData->SetPointCount(PathPointCount);
FXSYS_memcpy(pPathData->GetPoints(), m_pPathPoints,
sizeof(FX_PATHPOINT) * PathPointCount);
CFX_Matrix matrix = m_pCurStates->m_CTM;
matrix.Concat(m_mtContentToUser);
if (bStroke || FillType) {
CPDF_PathObject* pPathObj = new CPDF_PathObject;
pPathObj->m_bStroke = bStroke;
pPathObj->m_FillType = FillType;
pPathObj->m_Path = Path;
pPathObj->m_Matrix = matrix;
SetGraphicStates(pPathObj, TRUE, FALSE, TRUE);
pPathObj->CalcBoundingBox();
m_pObjectList->m_ObjectList.AddTail(pPathObj);
}
if (PathClipType) {
if (!matrix.IsIdentity()) {
Path.Transform(&matrix);
matrix.SetIdentity();
}
m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE);
}
}
示例6: DrawThisAppearance
void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) {
CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
CPDF_Rect rcClient = GetClientRect();
CFX_ByteTextBuf sLine;
int32_t nCharArray = m_pEdit->GetCharArray();
FX_SAFE_INT32 nCharArraySafe = nCharArray;
nCharArraySafe -= 1;
nCharArraySafe *= 2;
if (nCharArray > 0 && nCharArraySafe.IsValid()) {
switch (GetBorderStyle()) {
case PBS_SOLID: {
CFX_GraphStateData gsd;
gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
CFX_PathData path;
path.SetPointCount(nCharArraySafe.ValueOrDie());
for (int32_t i = 0; i < nCharArray - 1; i++) {
path.SetPoint(
i * 2,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
rcClient.bottom, FXPT_MOVETO);
path.SetPoint(
i * 2 + 1,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
rcClient.top, FXPT_LINETO);
}
if (path.GetPointCount() > 0)
pDevice->DrawPath(
&path, pUser2Device, &gsd, 0,
CPWL_Utils::PWLColorToFXColor(GetBorderColor(), 255),
FXFILL_ALTERNATE);
} break;
case PBS_DASH: {
CFX_GraphStateData gsd;
gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
gsd.SetDashCount(2);
gsd.m_DashArray[0] = (FX_FLOAT)GetBorderDash().nDash;
gsd.m_DashArray[1] = (FX_FLOAT)GetBorderDash().nGap;
gsd.m_DashPhase = (FX_FLOAT)GetBorderDash().nPhase;
CFX_PathData path;
path.SetPointCount(nCharArraySafe.ValueOrDie());
for (int32_t i = 0; i < nCharArray - 1; i++) {
path.SetPoint(
i * 2,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
rcClient.bottom, FXPT_MOVETO);
path.SetPoint(
i * 2 + 1,
rcClient.left +
((rcClient.right - rcClient.left) / nCharArray) * (i + 1),
rcClient.top, FXPT_LINETO);
}
if (path.GetPointCount() > 0)
pDevice->DrawPath(
&path, pUser2Device, &gsd, 0,
CPWL_Utils::PWLColorToFXColor(GetBorderColor(), 255),
FXFILL_ALTERNATE);
} break;
}
}
CPDF_Rect rcClip;
CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange();
CPVT_WordRange* pRange = NULL;
if (!HasFlag(PES_TEXTOVERFLOW)) {
rcClip = GetClientRect();
pRange = &wrRange;
}
IFX_SystemHandler* pSysHandler = GetSystemHandler();
IFX_Edit::DrawEdit(
pDevice, pUser2Device, m_pEdit,
CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()),
CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()),
rcClip, CPDF_Point(0.0f, 0.0f), pRange, pSysHandler, m_pFormFiller);
if (HasFlag(PES_SPELLCHECK)) {
CPWL_Utils::DrawEditSpellCheck(pDevice, pUser2Device, m_pEdit, rcClip,
CPDF_Point(0.0f, 0.0f), pRange,
GetCreationParam().pSpellCheck);
}
}