Replies: 1 comment 3 replies
-
The method Once you have changed the image, you can reuse the code from screenshot_manager.take_screenshot(window, move |img| {
// You can modify `img` here to resize it
match img.try_into_dynamic() {
Ok(dyn_img) => {
// Or modify `dyn_img` here for more powerful methods
match image::ImageFormat::from_path(&path) {
Ok(format) => {
let img = dyn_img.to_rgb8();
match img.save_with_format(&path, format) {
Ok(_) => info!("Screenshot saved to {}", path.display()),
Err(e) => error!("Cannot save screenshot, IO error: {e}"),
}
}
Err(e) => {
error!("Cannot save screenshot, requested format not recognized: {e}")
}
}
}
Err(e) => error!("Cannot save screenshot, screen format cannot be understood: {e}"),
}
}); |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, after 0.11 version, I found screenshot feature, but I couldn't change the size of a screenshot result png.
I can change bevy window size, but I just want to resize image.
Is there any way to change size of screenshot image?
Any hint is welcome!
Beta Was this translation helpful? Give feedback.
All reactions