Struct fltk::surface::ImageSurface [−][src]
pub struct ImageSurface { /* fields omitted */ }
An image surface object. Example usage:
use fltk::{prelude::*, *}; 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(enums::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]
&self,
win: &W,
x_offset: i32,
y_offset: i32
)
draw a decorated window
Trait Implementations
impl Drop for ImageSurface
[src]
impl SurfaceDevice for ImageSurface
[src]
fn is_current(&self) -> bool
[src]
fn surface() -> Self
[src]
fn push_current(new_current: &ImageSurface)
[src]
fn pop_current()
[src]
Auto Trait Implementations
impl RefUnwindSafe for ImageSurface
impl !Send for ImageSurface
impl !Sync for ImageSurface
impl Unpin for ImageSurface
impl UnwindSafe for ImageSurface
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>,