本文整理汇总了C++中CBCGPRect::SwapTopBottom方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPRect::SwapTopBottom方法的具体用法?C++ CBCGPRect::SwapTopBottom怎么用?C++ CBCGPRect::SwapTopBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPRect
的用法示例。
在下文中一共展示了CBCGPRect::SwapTopBottom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDraw
//*******************************************************************************
void CBCGPChartInterLineColoringEffect::OnDraw(CBCGPGraphicsManager* pGM)
{
ASSERT_VALID(this);
if (m_pSeries1 == NULL || m_arPointsSeries1.GetSize() < 2 || !IsVisible())
{
return;
}
BOOL bWasTransparency = CBCGPGraphicsManagerGDI::IsTransparencyEnabled();
CBCGPGraphicsManagerGDI::EnableTransparency();
BCGPChartFormatSeries::ChartCurveType curveType = m_pSeries1->GetCurveType();
if (curveType == BCGPChartFormatSeries::CCT_STEP || curveType == BCGPChartFormatSeries::CCT_REVERSED_STEP ||
m_pSeries2 != NULL && (m_pSeries2->GetCurveType() == BCGPChartFormatSeries::CCT_STEP ||
m_pSeries2->GetCurveType() == BCGPChartFormatSeries::CCT_REVERSED_STEP))
{
return;
}
CBCGPChartAxis* pXAxis = m_pSeries1->GetRelatedAxis(CBCGPChartSeries::AI_X);
CBCGPRect rectBounds = pXAxis->GetBoundingRect();
CBCGPChartAxis* pYAxis = m_pSeries1->GetRelatedAxis(CBCGPChartSeries::AI_Y);
if (pYAxis->m_bReverseOrder)
{
pYAxis->IsVertical() ? rectBounds.SwapTopBottom() : rectBounds.SwapLeftRight();
}
if (pXAxis->m_bReverseOrder)
{
pXAxis->IsVertical() ? rectBounds.SwapTopBottom() : rectBounds.SwapLeftRight();
}
BCGPSeriesColorsPtr colors;
m_pSeries1->GetColors(colors, -1);
CBCGPBrush& brFill = m_brTopBrush.IsEmpty() ? *colors.m_pBrElementFillColor : m_brTopBrush;
CBCGPGeometry* pDrawGeometry = CreateGeometry(m_arPointsSeries1, rectBounds, curveType, FALSE);
CBCGPGeometry* pClipGeometry = m_pSeries2 != NULL ?
CreateGeometry(m_arPointsSeries2, rectBounds, m_pSeries2->GetCurveType(), TRUE) :
CreateClipGeometry(m_dblOrigin);
ASSERT_VALID(pDrawGeometry);
ASSERT_VALID(pClipGeometry);
DrawEffect(pGM, pDrawGeometry, pClipGeometry, rectBounds, brFill);
delete pClipGeometry;
delete pDrawGeometry;
if (m_pSeries2 != NULL && m_arPointsSeries2.GetSize() > 2 && !m_bTopOnly)
{
BCGPSeriesColorsPtr colors;
m_pSeries2->GetColors(colors, -1);
pDrawGeometry = CreateGeometry(m_arPointsSeries2, rectBounds, m_pSeries2->GetCurveType(), FALSE);
pClipGeometry = CreateGeometry(m_arPointsSeries1, rectBounds, curveType, TRUE);
CBCGPBrush& brFill = m_brBottomBrush.IsEmpty() ? *colors.m_pBrElementFillColor : m_brBottomBrush;
DrawEffect(pGM, pDrawGeometry, pClipGeometry, rectBounds, brFill);
delete pClipGeometry;
delete pDrawGeometry;
}
CBCGPGraphicsManagerGDI::EnableTransparency(bWasTransparency);
}
示例2: OnCalcScreenPoints
//.........这里部分代码省略.........
else if (m_coordinateMode == CBCGPChartObject::CM_CHART_VALUES)
{
ASSERT_VALID(pXAxis);
ASSERT_VALID(pYAxis);
CBCGPRect rectCoordinates = m_rectCoordinates;
if (pXAxis != NULL && pXAxis->IsVertical())
{
rectCoordinates = CBCGPRect(m_rectCoordinates.bottom, m_rectCoordinates.right,
m_rectCoordinates.top, m_rectCoordinates.left);
pXAxis = m_pYAxis;
pYAxis = m_pXAxis;
}
if (pXAxis->m_bReverseOrder && !pXAxis->IsVertical())
{
if ((rectCoordinates.left != CBCGPChartObject::_EmptyCoordinate &&
rectCoordinates.right == CBCGPChartObject::_EmptyCoordinate) ||
(rectCoordinates.left == CBCGPChartObject::_EmptyCoordinate &&
rectCoordinates.right != CBCGPChartObject::_EmptyCoordinate))
{
rectCoordinates.SwapLeftRight();
}
}
if (pYAxis->m_bReverseOrder && pYAxis->IsVertical())
{
if ((rectCoordinates.top != CBCGPChartObject::_EmptyCoordinate &&
rectCoordinates.bottom == CBCGPChartObject::_EmptyCoordinate) ||
(rectCoordinates.top == CBCGPChartObject::_EmptyCoordinate &&
rectCoordinates.bottom != CBCGPChartObject::_EmptyCoordinate))
{
rectCoordinates.SwapTopBottom();
}
}
if (rectCoordinates.left != CBCGPChartObject::_EmptyCoordinate)
{
ptLeftTop.x = pXAxis->PointFromValue(rectCoordinates.left, FALSE);
}
else if (szObjectSize.cx == 0)
{
ptLeftTop.x = pXAxis->PointFromValue(pXAxis->GetMinDisplayedValue(TRUE), TRUE);
}
if (rectCoordinates.top != CBCGPChartObject::_EmptyCoordinate)
{
ptLeftTop.y = pYAxis->PointFromValue(rectCoordinates.top, FALSE);
}
else if (szObjectSize.cy == 0)
{
ptLeftTop.y = pYAxis->PointFromValue(pYAxis->GetMaxDisplayedValue(TRUE), TRUE);
}
if (rectCoordinates.right != CBCGPChartObject::_EmptyCoordinate)
{
ptRightBottom.x = pXAxis->PointFromValue(rectCoordinates.right, FALSE);
}
else if (szObjectSize.cx == 0)
{
ptRightBottom.x = pXAxis->PointFromValue(pXAxis->GetMaxDisplayedValue(TRUE), TRUE);
}
if (rectCoordinates.bottom != CBCGPChartObject::_EmptyCoordinate)
{