Struct fltk::surface::SvgFileSurface [−][src]
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]
&self,
win: &W,
x_offset: i32,
y_offset: i32
)
draw a decorated window
Trait Implementations
impl Drop for SvgFileSurface
[src]
impl SurfaceDevice for SvgFileSurface
[src]
fn is_current(&self) -> bool
[src]
fn surface() -> Self
[src]
fn push_current(new_current: &SvgFileSurface)
[src]
fn pop_current()
[src]
Auto Trait Implementations
impl RefUnwindSafe for SvgFileSurface
impl !Send for SvgFileSurface
impl !Sync for SvgFileSurface
impl Unpin for SvgFileSurface
impl UnwindSafe for SvgFileSurface
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,