Function fltk::draw::draw_rounded_rectf

source ·
pub fn draw_rounded_rectf(x: i32, y: i32, w: i32, h: i32, r: i32)
Expand description

Draws a filled rounded rectangle

Examples found in repository?
examples/shapedwindow_taskbar.rs (line 126)
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
fn prep_shape(w: i32, h: i32) -> image::RgbImage {
    let surf = surface::ImageSurface::new(w, h, false);

    surface::ImageSurface::push_current(&surf);

    draw::set_draw_color(enums::Color::Black);
    draw::draw_rectf(-1, -1, w + 2, h + 2);

    draw::set_draw_color(enums::Color::White);
    draw::draw_rounded_rectf(0, 0, w, h, 16);

    let img = surf.image().unwrap();

    surface::ImageSurface::pop_current();

    img
}