Struct fltk::surface::SvgFileSurface[][src]

pub struct SvgFileSurface { /* fields omitted */ }
Expand description

An SVG image surface object Example usage:

use fltk::{prelude::*, *};
let but = button::Button::new(0, 0, 80, 40, "Click");
// We need the destructor of SvgFileSurface to actually create the image
{
    let sur = surface::SvgFileSurface::new(but.width(), but.height(), "temp.svg");
    surface::SvgFileSurface::push_current(&sur);
    draw::set_draw_color(enums::Color::White);
    draw::draw_rectf(0, 0, but.width(), but.height());
    sur.draw(&but, 0, 0);
    surface::SvgFileSurface::pop_current();
}

Implementations

Returns a new SvgFileSurface

Sets the origin of the SvgFileSurface

Returns the width and height of the printable rect

Draw a widget in an svg file surface. The .svg file is not complete until the destructor was run

draw a decorated window

Trait Implementations

Executes the destructor for this type. Read more

Checks whether this surface is the current surface

Get the current surface

Push a surface as a current surface

Pop the current surface

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.