Struct fltk::surface::ImageSurface[][src]

pub struct ImageSurface { /* fields omitted */ }

An image surface object. Example usage:

use fltk::*;
let but = button::Button::new(0, 0, 80, 40, "Click");
let sur = surface::ImageSurface::new(but.width(), but.height(), false);
surface::ImageSurface::push_current(&sur);
draw::set_draw_color(Color::White);
draw::draw_rectf(0, 0, but.width(), but.height());
sur.draw(&but, 0, 0);
let img = sur.image().unwrap();
surface::ImageSurface::pop_current();

Implementations

impl ImageSurface[src]

pub fn new(w: i32, h: i32, high_res: bool) -> ImageSurface[src]

Creates a new image surface

pub fn image(&self) -> Option<RgbImage>[src]

Gets the image of an image surface as an rgb image

pub fn highres_image(&self) -> Option<SharedImage>[src]

Gets the high resolution image of an image surface as a shared image

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

Gets the origin coordinates of an image surface

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

Set the origin coordinates of an image surface

pub fn rescale(&mut self)[src]

Rescale an image surface

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

Draw a widget on the image surface

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 ImageSurface[src]

impl SurfaceDevice for ImageSurface[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.