本文整理汇总了C++中CPDF_Rect::Contains方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Rect::Contains方法的具体用法?C++ CPDF_Rect::Contains怎么用?C++ CPDF_Rect::Contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Rect
的用法示例。
在下文中一共展示了CPDF_Rect::Contains方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,CPDFSDK_Annot* pAnnot, CPDF_Point point)
{
CPDF_Rect rc = pAnnot->GetRect();
if(rc.Contains(point.x, point.y))
return TRUE;
return FALSE;
}
示例2: GetLinkAtPoint
CPDF_Link CPDF_LinkList::GetLinkAtPoint(CPDF_Page* pPage,
FX_FLOAT pdf_x,
FX_FLOAT pdf_y,
int* z_order) {
const std::vector<CPDF_Dictionary*>* pPageLinkList = GetPageLinks(pPage);
if (!pPageLinkList)
return CPDF_Link();
for (size_t i = pPageLinkList->size(); i > 0; --i) {
size_t annot_index = i - 1;
CPDF_Dictionary* pAnnot = (*pPageLinkList)[annot_index];
if (!pAnnot)
continue;
CPDF_Link link(pAnnot);
CPDF_Rect rect = link.GetRect();
if (!rect.Contains(pdf_x, pdf_y))
continue;
if (z_order)
*z_order = annot_index;
return link;
}
return CPDF_Link();
}
示例3: GetFocusBox
CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox();
if (rcPage.Contains(rcFocus))
return rcFocus;
}
return CPDF_Rect(0, 0, 0, 0);
}
示例4: HitTest
FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
const CPDF_Point& point) {
ASSERT(pPageView);
ASSERT(pAnnot);
CPDF_Rect rect = GetViewBBox(pPageView, pAnnot);
return rect.Contains(point.x, point.y);
}
示例5: GetFXAnnotAtPoint
CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX,
FX_FLOAT pageY) {
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_AnnotIterator annotIterator(this, false);
while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
if (rc.Contains(pageX, pageY))
return pSDKAnnot;
}
return nullptr;
}
示例6: OnLButtonDown
FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
const CPDF_Point& point) {
CPDF_Rect rcAnnot = pAnnot->GetRect();
if (!rcAnnot.Contains(point.x, point.y))
return FALSE;
m_bMouseDown = TRUE;
m_bValid = TRUE;
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rect.left, rect.top, rect.right, rect.bottom);
return TRUE;
}
示例7: GetLinkAtPoint
CPDF_Link CPDF_LinkList::GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y)
{
CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
if (pPageLinkList == NULL) {
return NULL;
}
int size = pPageLinkList->GetSize();
for (int i = 0; i < size; i ++) {
CPDF_Link Link = (CPDF_Dictionary*)pPageLinkList->GetAt(i);
CPDF_Rect rect = Link.GetRect();
if (rect.Contains(pdf_x, pdf_y)) {
return Link;
}
}
return NULL;
}
示例8: GetFXAnnotAtPoint
CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, FX_FLOAT pageY)
{
CPDFSDK_AnnotIterator annotIterator(this, FALSE);
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_Annot* pSDKAnnot = NULL;
int index = -1;
while((pSDKAnnot = annotIterator.Next(index)))
{
CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
if(rc.Contains(pageX, pageY))
return pSDKAnnot;
}
return NULL;
}