本文整理汇总了C++中CBCGPRect::InflateRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPRect::InflateRect方法的具体用法?C++ CBCGPRect::InflateRect怎么用?C++ CBCGPRect::InflateRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPRect
的用法示例。
在下文中一共展示了CBCGPRect::InflateRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HitTest
//*******************************************************************************
BOOL CBCGPChartLineObject::HitTest(const CBCGPPoint& pt) const
{
double dblWidth = m_format.m_outlineFormat.GetLineWidth(TRUE) / 2;
CBCGPPoint ptTopLeft = m_rectScreen.TopLeft();
CBCGPPoint ptBottomRight = m_rectScreen.BottomRight();
if (ptTopLeft.x == ptBottomRight.x)
{
CBCGPRect r = m_rectScreen.NormalizedRect();
r.InflateRect(dblWidth, dblWidth);
return r.PtInRect(pt);
}
double dblACoef = (ptBottomRight.y - ptTopLeft.y) / (ptBottomRight.x - ptTopLeft.x);
double dblBCoef = ptBottomRight.y - dblACoef * ptBottomRight.x;
double dblY = dblACoef * pt.x + dblBCoef;
return pt.y > dblY - dblWidth && pt.y < dblY + dblWidth;
}
示例2: OnDraw
//.........这里部分代码省略.........
center.y - sin(dblMiddleAngleRad) * 2 * radius / 3);
dblStartAngle = dblFinishAngle;
}
else
{
pItem->m_Shape.SetStart(center);
pItem->m_Shape.AddLine(center);
pGM->CombineGeometry(pItem->m_Shape, pItem->m_Shape, CBCGPEllipseGeometry(CBCGPEllipse(center, radiusSmall, radiusSmall)), RGN_OR);
pItem->m_ptCenter = center;
}
}
}
CBCGPEllipse ellipseInt(center, radiusSmall, radiusSmall);
CBCGPRect rectShadow = rect;
rectShadow.OffsetRect(m_nShadowDepth, m_nShadowDepth);
if (!m_bHasCenterButton && m_pCtrl->GetSafeHwnd() != NULL && (m_pCtrl->GetExStyle() & WS_EX_LAYERED))
{
if (m_nShadowDepth > 0)
{
CBCGPEllipseGeometry egShadow(rectShadow);
CBCGPPoint centerShadow = center;
centerShadow.x += m_nShadowDepth;
centerShadow.y += m_nShadowDepth;
CBCGPEllipse ellipseIntShadow(centerShadow, radiusSmall, radiusSmall);
CBCGPEllipseGeometry egInternalShadow(ellipseIntShadow);
CBCGPComplexGeometry shapeShadow;
pGM->CombineGeometry(shapeShadow, egShadow, egInternalShadow, RGN_DIFF);
pGM->FillGeometry(shapeShadow, m_brShadow);
}
CBCGPEllipseGeometry eg(rect);
CBCGPEllipseGeometry egInternal(ellipseInt);
CBCGPComplexGeometry shape;
pGM->CombineGeometry(shape, eg, egInternal, RGN_DIFF);
pGM->FillGeometry(shape, m_brFill);
}
else
{
if (m_nShadowDepth > 0)
{
pGM->FillEllipse(rectShadow, m_brShadow);
}
pGM->FillEllipse(rect, m_brFill);
}
pGM->DrawEllipse(rect, m_brBorder);
if (!pGM->IsSupported(BCGP_GRAPHICS_MANAGER_COLOR_OPACITY))
{
CBCGPRect rect1 = rect;
rect1.DeflateRect(1, 1);
pGM->DrawEllipse(rect1, m_brFill);
}
BOOL bIsCtrlDisabled = m_pCtrl->GetSafeHwnd() != NULL && !m_pCtrl->IsWindowEnabled();
for (int i = 0; i < nItems; i++)
{
CBCGPRadialMenuItem* pItem = m_arItems[i];
ASSERT_VALID(pItem);
if (i == m_nHighlighted)
{
pGM->FillGeometry(pItem->m_Shape, m_nHighlighted == m_nPressed ? m_brPressed :
m_brHighlighted.IsEmpty() ? m_brFill : m_brHighlighted);
}
pItem->OnDrawIcon(pGM, bIsCtrlDisabled, m_Icons, sizeIcon);
pGM->DrawGeometry(pItem->m_Shape, m_brBorder);
}
pGM->DrawEllipse(ellipseInt, m_brBorder);
if (!pGM->IsSupported(BCGP_GRAPHICS_MANAGER_ANTIALIAS))
{
rect.InflateRect(1, 1);
pGM->DrawEllipse(rect, m_brBorder);
}
if (m_pCtrl->GetSafeHwnd() != NULL && m_pCtrl->IsFocused() && !m_pCtrl->IsPopup())
{
rect.InflateRect(1, 1);
pGM->DrawEllipse(rect, m_brFocusedBorder);
}
}