add a new member function of pixel_buffer for rotating image

This commit is contained in:
Jinhao
2016-05-22 02:51:30 +08:00
parent 9947d0c511
commit 6217232a31
4 changed files with 216 additions and 24 deletions

View File

@@ -1112,6 +1112,29 @@ namespace paint
line_to({ r.x, r.y }, left_clr);
}
void graphics::frame_rectangle(const ::nana::rectangle& r, const color& clr, unsigned gap)
{
palette(false, clr);
if (r.width > gap * 2)
{
point left{ r.x + static_cast<int>(gap), r.y }, right{ r.right() - static_cast<int>(gap) - 1, r.y };
line(left, right);
left.y = right.y = r.bottom() - 1;
line(left, right);
}
if (r.height > gap * 2)
{
point top{ r.x, r.y + static_cast<int>(gap) }, bottom{ r.x, r.bottom() - static_cast<int>(gap) - 1 };
line(top, bottom);
top.x = bottom.x = r.right() - 1;
line(top, bottom);
}
}
void graphics::gradual_rectangle(const ::nana::rectangle& rct, const ::nana::color& from, const ::nana::color& to, bool vertical)
{
#if defined(NANA_WINDOWS)