本文整理汇总了C++中clan::Canvas::draw_box方法的典型用法代码示例。如果您正苦于以下问题:C++ Canvas::draw_box方法的具体用法?C++ Canvas::draw_box怎么用?C++ Canvas::draw_box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clan::Canvas
的用法示例。
在下文中一共展示了Canvas::draw_box方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: linec
void why::Application::draw_info_box(clan::Canvas &c)
{
c.fill_rect(m_world_area, clan::Colorf(0.0f, 0.0f, 0.0f, 0.6f));
static clan:: Colorf linec(clan::Colorf::white);
linec.set_alpha(0.3f);
c.draw_box(m_world_area, linec);
}
示例2: on_render_overlay
void GridComponent::on_render_overlay(clan::Canvas &canvas, const clan::Rect &update_rect)
{
set_cliprect(canvas, get_size());
std::vector<GridObject *> selection = main_window->get_selection()->get_selection();
for (size_t i = 0; i < selection.size(); i++)
{
clan::Rect grabbers[8] =
{
selection[i]->get_grabber_e(),
selection[i]->get_grabber_se(),
selection[i]->get_grabber_s(),
selection[i]->get_grabber_sw(),
selection[i]->get_grabber_w(),
selection[i]->get_grabber_nw(),
selection[i]->get_grabber_n(),
selection[i]->get_grabber_ne()
};
for (int j=0; j<8; j++)
grabbers[j] = window_to_component_coords(selection[i]->component_to_window_coords(grabbers[j]));
clan::Rect pos = window_to_component_coords(selection[i]->component_to_window_coords(selection[i]->get_size()));
pos.expand(4,4,3,3);
canvas.draw_box( pos, clan::Colorf(100.0f/255.0f, 100.0f/255.0f, 100.0f/255.0f, 0.25f));
for (int j=0; j<8; j++)
{
canvas.fill_rect( grabbers[j], clan::Colorf::white);
canvas.draw_box( grabbers[j], clan::Colorf::black);
}
}
if (netselect_box.get_size() != clan::Size(0,0))
{
clan::Rect box = netselect_box;
box.translate(component_container->get_geometry().left, component_container->get_geometry().top);
clan::Colorf c = clan::Colorf::blue;
c.set_alpha(0.1f);
canvas.fill_rect( box, c);
canvas.draw_box( box, clan::Colorf::blue);
}
reset_cliprect(canvas);
}