• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setFillColor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setFillColor函数的典型用法代码示例。如果您正苦于以下问题:C++ setFillColor函数的具体用法?C++ setFillColor怎么用?C++ setFillColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: MapItem

Zone::Zone(QGraphicsItem *parent) :
    MapItem(parent)
{
    // Set parameters
    width = 501;
    height = 512;
    setLineColor(QColor(Qt::white));
    setFillColor(QColor(Qt::white));
}
开发者ID:cfezequiel,项目名称:mscs-thesis,代码行数:9,代码来源:zone.cpp


示例2: initPaddle

/**
 * Instantiates paddle in bottom-middle of window.
 */
GRect initPaddle(GWindow window)
{
    GRect paddle = newGRect(((WIDTH/2)-35), 550, P_WIDTH, P_HEIGHT);
    setColor(paddle, "BLACK");
    setFillColor(paddle, "BLACK");
    setFilled(paddle, true);
    add(window, paddle);
    return paddle;
}
开发者ID:abhinavp99,项目名称:CS50-pset3,代码行数:12,代码来源:breakout.c


示例3: setRadius

Prey::Prey()
{
	setRadius(8);
	setFillColor(Color::Green);
	vX = .8;
	vY = .8;
	setPosition(5, 50);

}
开发者ID:CarsonV,项目名称:Final,代码行数:9,代码来源:Prey.cpp


示例4: ASSERT

void GraphicsContext::setFillPattern(PassRefPtr<Pattern> pattern)
{
    ASSERT(pattern);
    if (!pattern) {
        setFillColor(Color::black, ColorSpaceDeviceRGB);
        return;
    }
    m_state.fillGradient.clear();
    m_state.fillPattern = pattern;
}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:10,代码来源:GraphicsContext.cpp


示例5: setFillColor

//example implementation
void Button::animation_upadate()
{
	if(!m_isEnabled)
	{
		setFillColor(m_color_disabled);
		return;
	}

	Color c = m_color_mouseOver;

	double ratio1 =  sqrt((double)m_animation) / sqrt((double)m_animationLength);
	double ratio2 = 1 - ratio1;
	setFillColor(Color( (Uint8)(c.r * ratio1 + m_color.r * ratio2),
						(Uint8)(c.g * ratio1 + m_color.g * ratio2),
						(Uint8)(c.b * ratio1 + m_color.b * ratio2),
						(Uint8)(c.a * ratio1 + m_color.a * ratio2)));
	
	updateVisuals();
}
开发者ID:Bur0k,项目名称:D45az,代码行数:20,代码来源:Button.cpp


示例6: _label

TextButton::TextButton(const std::string &text, sf::Font& font, Widget *parent)
    :Button(parent), _label(text, font, nullptr){

    _label = Label (text, font, this);

    setFillColor(sf::Color(153,204,255));
    setOutlineThickness(2);
    setOutlineColor(sf::Color(0,153,153));

}
开发者ID:kaitokidi,项目名称:JacobsHack,代码行数:10,代码来源:TextButton.cpp


示例7: ASSERT

void GraphicsContext::setFillGradient(PassRefPtr<Gradient> gradient)
{
    ASSERT(gradient);
    if (!gradient) {
        setFillColor(Color::black);
        return;
    }
    m_common->state.fillColorSpace = GradientColorSpace;
    m_common->state.fillGradient = gradient;
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:10,代码来源:GraphicsContext.cpp


示例8: save

void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, const Color& shadowColor)
{
    if (paintingDisabled())
        return;

    save();

    setStrokeColor(shadowColor);
    setFillColor(shadowColor);

    drawEllipse(FloatRect(rect.x(), rect.y() + 1, rect.width(), rect.height()));

    setStrokeColor(ellipseColor);
    setFillColor(ellipseColor);

    drawEllipse(rect);  

    restore();
}
开发者ID:josedealcala,项目名称:webkit,代码行数:19,代码来源:GraphicsContext.cpp


示例9: initBricks

/**
 * Initializes window with a grid of bricks.
 */
void initBricks(GWindow window)
{
    int b_y = 40;
    for (int i = 0; i < 5; i++)
    {
        int b_x = 2;
        for (int j = 0; j < 10; j++)
        {            
            GRect bricks = newGRect(b_x, b_y, 35, 10);
            add(window, bricks);
                       
            if (i == 0)
            {
                setFillColor(bricks, "BLUE");
            } 
            else if (i == 1)
            {
                setFillColor(bricks, "BLACK");
            } 
            else if (i == 2)
            {
                setFillColor(bricks, "RED");
            } 
            else if (i == 3)
            {
                setFillColor(bricks, "YELLOW");
            } 
            else if (i == 4)
            {
                setFillColor(bricks, "GREEN");
            }         
                       
            setFilled(bricks, true);            
             
            b_x = b_x + 40;            
            
                       
        }
        b_y = b_y + 20;
        
    }
}
开发者ID:abhinavp99,项目名称:CS50-pset3,代码行数:45,代码来源:breakout.c


示例10: draw

void draw(void *userData)
{
	/* Draw rectangle */
	setPenColor(POLO_TRANSPARENT);
	setFillColor(POLO_MIDNIGHT);
	drawRect(0, 0, 120, 44);
	
	/* Draw hello world */
	setPenColor(POLO_WHITE);
	drawText(10, 10, "Hello world");
}
开发者ID:liam-middlebrook,项目名称:libpolo,代码行数:11,代码来源:demo_helloworld.c


示例11: setFrameColor

//-----------------------------------------------------------------------------
void CDrawContext::init ()
{
	// set the default values
	setFrameColor (kWhiteCColor);
	setLineStyle (kLineSolid);
	setLineWidth (1);
	setFillColor (kBlackCColor);
	setFontColor (kWhiteCColor);
	setFont (kSystemFont);
	setDrawMode (kAliasing);
	setClipRect (surfaceRect);
}
开发者ID:sa-tsuklog,项目名称:MyLib,代码行数:13,代码来源:cdrawcontext.cpp


示例12: color

//-----------------------------------------------------------------------------
void D2DDrawContext::setGlobalAlpha (float newAlpha)
{
    if (currentState.globalAlpha == newAlpha)
        return;
    COffscreenContext::setGlobalAlpha (newAlpha);
    CColor color (currentState.frameColor);
    currentState.frameColor = kTransparentCColor;
    setFrameColor (color);
    color = currentState.fillColor;
    currentState.fillColor = kTransparentCColor;
    setFillColor (color);
    color = currentState.fontColor;
    currentState.fontColor = kTransparentCColor;
    setFontColor (color);
}
开发者ID:kchikamura,项目名称:vstplugin,代码行数:16,代码来源:d2ddrawcontext.cpp


示例13: setIsDrag

bool CircleObject::init()
{
	setIsDrag(false);
	setObjectType(ObjectType::CIRCLE_OBJECT);
	setTypeName("CircleObject");
	m_drawnode = CCDrawNode::create();
	addChild(m_drawnode);

	registerWithTouchDispatcher();

	setBorderColor(ccc4f(1, 0, 0, 1));
	setFillColor(ccc4f(0.5, 0.5, 0.5, 0.5));
	m_radius = 10;
	return true;
}
开发者ID:cubemoon,项目名称:SceneEditor-1,代码行数:15,代码来源:CircleObject.cpp


示例14: fillRule

void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color)
{
    if (paintingDisabled())
        return;

    Path path;
    path.addRect(rect);

    if (!roundedHoleRect.radii().isZero())
        path.addRoundedRect(roundedHoleRect);
    else
        path.addRect(roundedHoleRect.rect());

    WindRule oldFillRule = fillRule();
    Color oldFillColor = fillColor();
    
    setFillRule(RULE_EVENODD);
    setFillColor(color);

    fillPath(path);
    
    setFillRule(oldFillRule);
    setFillColor(oldFillColor);
}
开发者ID:josedealcala,项目名称:webkit,代码行数:24,代码来源:GraphicsContext.cpp


示例15: DrawSolidCircle

void MyDebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color)
{
    auto circle = sf::CircleShape(radius);
    circle.setPosition(center.x - radius, center.y - radius);
    circle.setFillColor(B2SFColor(color));
    this->m_window->draw(circle);

    // line of the circle wich shows the angle
    b2Vec2 p = center + (radius * axis);
    sf::VertexArray lines(sf::Lines, 2);
    lines[0].color = sf::Color(0,0,0);
    lines[0].position = sf::Vector2f(center.x, center.y);
    lines[1].position = sf::Vector2f(p.x, p.y);
    this->m_window->draw(lines);
}
开发者ID:EmileSonneveld,项目名称:SpaceGame,代码行数:15,代码来源:DebugDraw.cpp


示例16: setSize

Starship::Starship(VideoConfig &videoConfig) : sf::RectangleShape()
{
	this->videoConfig = videoConfig;
	Speed = 600.0;
	BorderWidth = -2;
	BackgroundColor = sf::Color(255,255,255);
	BorderColor = sf::Color(0,0,0);

	setSize(sf::Vector2f(100, 18));
	setOrigin(50, 9);
	setFillColor(BackgroundColor);
	setOutlineColor(BorderColor);
	setOutlineThickness(BorderWidth);

	setPosition(videoConfig.Width / 2, videoConfig.Height - 40);
}
开发者ID:tecnologiamuerta,项目名称:Arkanoid,代码行数:16,代码来源:Starship.cpp


示例17: load

    void load( Archive & ar, const unsigned int file_version ) {
        (void) file_version;
        (void) ar;

	this->
	setPointCount(points.size());
	deque<Point>::iterator it;
	unsigned int i=0;
	for(it=points.begin();it != points.end(); it++){
	  setPoint(i, sf::Vector2f(it->getX(), it->getY()));
	  i++;
	}
	setFillColor(sf::Color(100,100,100,100));
	setOutlineColor(sf::Color::Red);
	setOutlineThickness(3.);
    }
开发者ID:matthieu637,项目名称:risk,代码行数:16,代码来源:Polygon.hpp


示例18: main

int main()
{
    sf::RenderWindow window(sf::VideoMode(500, 500), "Fading Dots");
    window.setFramerateLimit(60);

    sf::Vector2f old_pos(0.f, 0.f);
    const int STEP = 1;

    std::list<sf::CircleShape> points;

    while(window.isOpen())
    {
        sf::Event event;
        while(window.pollEvent(event))
        {
            if(event.type == sf::Event::Closed)
                window.close();
        }

        // Check if the mouse has moved
        sf::Vector2f pos = static_cast<sf::Vector2f>(sf::Mouse::getPosition(window));
        if(pos != old_pos)
        {
            // Create and add a new circle to the points list.
            sf::CircleShape cs;
            cs.setRadius(10.f);
            cs.setPosition(pos);
            cs.setFillColor(sf::Color::Red);
            points.push_back(cs);

            old_pos = pos;
        }

        window.clear();

        for(auto it = points.begin(); it != points.end(); ++it)
        {
            window.draw(*it);
            if(it->getFillColor().a-STEP < 0) // When the transparency falls below zero (= invisible) then erase the dot.
                it = points.erase(it);
            else // Otherwise draw it with a increasing green touch (turns yellowish).
                it->setFillColor(sf::Color(255, it->getFillColor().g+STEP, 0, it->getFillColor().a-STEP));
        }

        window.display();
    }
}
开发者ID:eXpl0it3r,项目名称:Examples,代码行数:47,代码来源:FadingDots.cpp


示例19: setFillColor

polyFixWidth::polyFixWidth()
{
	polySimple::polySimple();
	polyAdv::polyAdv();
	polyEditable::polyEditable();
	
	center.set(0,0);
	width = 1;
	bSquare = false;
	length = 0;
	
	ppA.set(0,0);
	ppB.set(0,0);
	
	setFillColor(200,200,200,100);
	setStrokeColor(255,0,0,255);
}
开发者ID:csugrue,项目名称:GA_Interactive,代码行数:17,代码来源:polyFixWidth.cpp


示例20: Block

    Block()
    {
        setPointCount(point_number);
        setFillColor(sf::Color(200, 100, 100));
        setOutlineColor(sf::Color(255, 100, 100));
        setOutlineThickness(2.f);

        setPoint(0, sf::Vector2f(0, 0));
        setPoint(1, sf::Vector2f(length1, 0));
        setPoint(2, sf::Vector2f(length1 + offset_length, offset_depth));
        setPoint(3, sf::Vector2f(length1 + offset_length + length2, offset_depth));
        setPoint(4, sf::Vector2f(length1 + offset_length * 2 + length2, 0));
        setPoint(5, sf::Vector2f(min_width, 0));

        for(std::size_t i = 0; i < 6; ++i)
            setPoint(11 - i, getPoint(i) + sf::Vector2f(0, min_height));
    }
开发者ID:Delaunay,项目名称:symdiff,代码行数:17,代码来源:window.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setFilled函数代码示例发布时间:2022-05-30
下一篇:
C++ setFileName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap