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

pub struct SvgFileSurface { /* fields omitted */ }

An SVG image surface object Example usage:

use fltk::*;
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(Color::White);
    draw::draw_rectf(0, 0, but.width(), but.height());
    sur.draw(&but, 0, 0);
    surface::SvgFileSurface::pop_current();
}

Implementations

impl SvgFileSurface[src]

pub fn new<P: AsRef<Path>>(width: i32, height: i32, path: P) -> SvgFileSurface[src]

Returns a new SvgFileSurface

pub fn set_origin(&mut self, x: i32, y: i32)[src]

Sets the origin of the SvgFileSurface

pub fn printable_rect(&self) -> (i32, i32)[src]

Returns the width and height of the printable rect

pub fn draw<W: WidgetExt>(&self, widget: &W, delta_x: i32, delta_y: i32)[src]

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

pub fn draw_decorated_window<W: WindowExt>(
    &self,
    win: &W,
    x_offset: i32,
    y_offset: i32
)
[src]

draw a decorated window

Trait Implementations

impl Drop for SvgFileSurface[src]

impl SurfaceDevice for SvgFileSurface[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.