当前位置: 首页>>代码示例>>C++>>正文


C++ Pen::SetColor方法代码示例

本文整理汇总了C++中Pen::SetColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Pen::SetColor方法的具体用法?C++ Pen::SetColor怎么用?C++ Pen::SetColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pen的用法示例。


在下文中一共展示了Pen::SetColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: draw

VOID Button::draw(Graphics *pGraphics, Pen &rPen, SolidBrush &rBrush, CONST Font &/*rFont*/) const
{
	rPen.SetColor(Color(5, 159, 225));
	rPen.SetWidth(3);
	rBrush.SetColor(Color(255, 125, 34));
	
	pGraphics->DrawRectangle(&rPen, RECT2Rect());
	//graphics->DrawString(text_.c_str(), text_.length(), &font, PointF(RECT2RectF().GetLeft(), RECT2RectF().GetTop()), &brush);
}
开发者ID:MyLibh,项目名称:Billiards,代码行数:9,代码来源:Button.cpp

示例2: draw

VOID vec::draw(double x0, double y0, Graphics *graphics, Pen &rPen, CONST Color &rColor /* = Color::Yellow */) const
{
	rPen.SetColor(rColor);
	rPen.SetWidth(2);

    graphics->DrawLine(&rPen, Point(static_cast<INT>(x0     ), static_cast<INT>(     y0)), Point(static_cast<INT>(x0 + x_), static_cast<INT>(y_ + y0)));
    graphics->DrawLine(&rPen, Point(static_cast<INT>(x0 + x_), static_cast<INT>(y_ + y0)), Point(static_cast<INT>(x0 + x_ - ((l_ < 0)? -1 : 1) * 5 * cos(k_ + M_PI_4)), static_cast<INT>(y_ + y0 - ((l_ < 0)? -1 : 1) * 5 * sin(k_ + M_PI_4))));
    graphics->DrawLine(&rPen, Point(static_cast<INT>(x0 + x_), static_cast<INT>(y_ + y0)), Point(static_cast<INT>(x0 + x_ - ((l_ < 0)? -1 : 1) * 5 * cos(k_ - M_PI_4)), static_cast<INT>(y_ + y0 - ((l_ < 0)? -1 : 1) * 5 * sin(k_ - M_PI_4))));

    l_ = sqrt(x_ * x_ + y_ * y_);
    k_ = atan_(x_, y_);
}
开发者ID:MyLibh,项目名称:Billiards,代码行数:12,代码来源:Vector.cpp

示例3: draw

VOID Cue::draw(Graphics *pGraphics, Pen &rPen, Image &rCue) const
{	
	auxiliaryLine_.draw((ball_ - auxiliaryLine_).getX(), (ball_ - auxiliaryLine_).getY(), pGraphics, rPen, static_cast<ARGB>(Color::Gray));

	rPen.SetColor(static_cast<ARGB>(Color::Gray));
	rPen.SetWidth(3);
	pGraphics->DrawEllipse(&rPen, static_cast<INT>(mouse_.getX() - RShari), static_cast<INT>(mouse_.getY() - RShari), RShari * 2, RShari * 2);

	pGraphics->TranslateTransform(static_cast<REAL>(ball_.getX()), static_cast<REAL>(ball_.getY()));
	pGraphics->RotateTransform(angle_); 
	
	ImageAttributes imAttr;
	imAttr.SetColorKey(COLOR_KEY, COLOR_KEY);		
	pGraphics->DrawImage(&rCue, Rect(static_cast<INT>(-884 - force_ * 8), static_cast<INT>(-20 / 2), 884 * 2, 20), 0, 0, 884 * 2, 20, Unit::UnitPixel, &imAttr, 0);

	pGraphics->ResetTransform();
}
开发者ID:MyLibh,项目名称:Billiards,代码行数:17,代码来源:Cue.cpp


注:本文中的Pen::SetColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。