save_gui_screenshot/save_gui_screenshot.rs
1//use flameshot::FullArgs;
2use flameshot::GuiArgs;
3//use flameshot::ScreenArgs;
4
5pub fn main() {
6 /// We select one of the 3 main param types and use the builder method to
7 /// customize the cli arguments, it includes all flameshot cli args.
8 let params = GuiArgs::builder()
9 .path("screenshot.png")
10 .accept_on_select()
11 //.region((100, 100, 100, 100)) // just to show how one could use region param
12 .build();
13 /// This operation can error, it can error because of OS problems
14 /// or Flameshot problems.
15 let output = flameshot::execute(params).unwrap();
16}