Function fltk::draw::capture_surface

source ·
pub fn capture_surface(
    surface: &ImageSurface,
    w: i32,
    h: i32
) -> Result<RgbImage, FltkError>
Expand description

Captures the image surface object and returns raw data. Example usage:

use fltk::{prelude::*, *};
let mut surface = surface::ImageSurface::new(100, 100, false);
let image = draw::capture_surface(&mut surface, 100, 100).unwrap();

Errors

The api can fail to capture the image surface as an image