You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add `Frame::request_screenshot` and `Frame::screenshot` to communicate to the backend that a screenshot of the current frame should be exposed by `Frame` during `App::post_rendering` ([#2676](https://github.com/emilk/egui/pull/2676))
/// Request the current frame's pixel data. Needs to be retrieved by calling [`Frame::screenshot`]
704
+
/// during [`App::post_rendering`].
705
+
#[cfg(not(target_arch = "wasm32"))]
706
+
pubfnrequest_screenshot(&mutself){
707
+
self.output.screenshot_requested = true;
708
+
}
709
+
710
+
/// Cancel a request made with [`Frame::request_screenshot`].
711
+
#[cfg(not(target_arch = "wasm32"))]
712
+
pubfncancel_screenshot_request(&mutself){
713
+
self.output.screenshot_requested = false;
714
+
}
715
+
716
+
/// During [`App::post_rendering`], use this to retrieve the pixel data that was requested during
717
+
/// [`App::update`] via [`Frame::request_screenshot`].
718
+
///
719
+
/// Returns None if:
720
+
/// * Called in [`App::update`]
721
+
/// * [`Frame::request_screenshot`] wasn't called on this frame during [`App::update`]
722
+
/// * The rendering backend doesn't support this feature (yet). Currently implemented for wgpu and glow, but not with wasm as target.
723
+
/// * Retrieving the data was unsuccessful in some way.
724
+
///
725
+
/// See also [`egui::ColorImage::region`]
726
+
///
727
+
/// ## Example generating a capture of everything within a square of 100 pixels located at the top left of the app and saving it with the [`image`](crates.io/crates/image) crate:
Copy file name to clipboardexpand all lines: crates/egui-wgpu/CHANGELOG.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ All notable changes to the `egui-wgpu` integration will be noted in this file.
3
3
4
4
5
5
## Unreleased
6
+
* Add `read_screan_rgba` to the egui-wgpu `Painter`, to allow for capturing the current frame when using wgpu. Used in conjuction with `Frame::request_screenshot`. ([#2676](https://github.com/emilk/egui/pull/2676))
6
7
7
8
8
9
## 0.21.0 - 2023-02-08
@@ -12,7 +13,6 @@ All notable changes to the `egui-wgpu` integration will be noted in this file.
12
13
*`egui-wgpu` now only depends on `epaint` instead of the entire `egui` ([#2438](https://github.com/emilk/egui/pull/2438)).
13
14
*`winit::Painter` now supports transparent backbuffer ([#2684](https://github.com/emilk/egui/pull/2684)).
14
15
15
-
16
16
## 0.20.0 - 2022-12-08 - web support
17
17
* Renamed `RenderPass` to `Renderer`.
18
18
* Renamed `RenderPass::execute` to `RenderPass::render`.
0 commit comments