本文整理汇总了C++中Layer::DrawLine方法的典型用法代码示例。如果您正苦于以下问题:C++ Layer::DrawLine方法的具体用法?C++ Layer::DrawLine怎么用?C++ Layer::DrawLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layer
的用法示例。
在下文中一共展示了Layer::DrawLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillBackGround
void BlueDecorator::FillBackGround(void )
{
Layer* pcView = GetLayer();
Rect cOBounds = pcView->GetBounds();
Color32_s sFillColor = m_bHasFocus ? Color32_s(62,101,172,255):Color32_s(191,191,191,255) ;
Color32_s col_Light = m_bHasFocus ? Color32_s (32,71,142,255):Color32_s(191,191,191,255) ;
Color32_s col_Dark = m_bHasFocus ? Color32_s (62,101,172,255):Color32_s(221,221,221,255);
Point Left = Point(cOBounds.left+1, cOBounds.top+1);
Point Right = Point(cOBounds.right-1, cOBounds.top+1);
Color32_s col_Grad = col_Light;
Color32_s col_Step = Color32_s( (col_Light.red-col_Dark.red)/15,
(col_Light.green-col_Dark.green)/15,
(col_Light.blue-col_Dark.blue)/15, 0 );
for (int i=0; i<25; i++)
{
pcView->SetFgColor( col_Grad );
pcView->DrawLine( Left, Right );
Left.y += 1;
Right.y += 1;
col_Grad.red -= col_Step.red;
col_Grad.green -= col_Step.green;
col_Grad.blue -= col_Step.blue;
}
// left
pcView->FillRect( Rect(cOBounds.left,cOBounds.top+m_vTopBorder,
cOBounds.left+m_vLeftBorder,cOBounds.bottom+m_vLeftBorder),sFillColor);
// right
pcView->FillRect( Rect(cOBounds.right-m_vRightBorder,cOBounds.top+m_vTopBorder,
cOBounds.right,cOBounds.bottom),sFillColor);
// bottom
pcView->FillRect( Rect(cOBounds.left,cOBounds.bottom-m_vBottomBorder,
cOBounds.right,cOBounds.bottom),sFillColor);
}
示例2: DrawFrameBorders
void BlueDecorator::DrawFrameBorders (void)
{
Layer* pcView = GetLayer();
Rect cOBounds = pcView->GetBounds();
// outside
pcView->SetFgColor( 15, 32, 50, 255 );
pcView->DrawLine (Point (cOBounds.left,cOBounds.top),Point (cOBounds.right,cOBounds.top));
pcView->DrawLine (Point (cOBounds.right,cOBounds.bottom));
pcView->DrawLine (Point (cOBounds.left,cOBounds.bottom));
pcView->DrawLine (Point (cOBounds.left,cOBounds.top));
// outside light
Color32_s sLightColor = m_bHasFocus ? Color32_s(100,144,223,255):Color32_s(244,244,244,255) ;
pcView->SetFgColor(sLightColor);
pcView->DrawLine (Point (cOBounds.left+1,cOBounds.top+1),Point (cOBounds.right-1,cOBounds.top+1));
pcView->DrawLine (Point (cOBounds.left+1,cOBounds.top+1),Point (cOBounds.left+1,cOBounds.bottom-1));
// outside dark
Color32_s sDarkColor = m_bHasFocus ? Color32_s(25,62,80,255):Color32_s(184,184,184,255) ;
pcView->SetFgColor( sDarkColor );
pcView->DrawLine (Point (cOBounds.left+1,cOBounds.bottom-1),Point (cOBounds.right-1,cOBounds.bottom-1));
pcView->DrawLine (Point (cOBounds.right-1,cOBounds.bottom-1),Point (cOBounds.right-1,cOBounds.top+2));
// inside
pcView->SetFgColor( 29, 64, 98, 255 );
pcView->DrawLine (Point (cOBounds.left+m_vLeftBorder, cOBounds.top+(m_vTopBorder-1)),
Point (cOBounds.right-(m_vRightBorder-1),cOBounds.top+m_vTopBorder-1));
pcView->DrawLine (Point (cOBounds.right-(m_vRightBorder-1),cOBounds.bottom-(m_vBottomBorder-1)));
pcView->DrawLine (Point (cOBounds.left+(m_vLeftBorder-1), cOBounds.bottom-(m_vBottomBorder-1)));
pcView->DrawLine (Point (cOBounds.left+(m_vLeftBorder-1), cOBounds.top+(m_vTopBorder-1)));
}