Function capture_surface
pub fn capture_surface(
surface: &ImageSurface,
w: i32,
h: i32,
) -> Result<RgbImage, FltkError> ⓘ
Available on crate feature
dep_fltk
only.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