Ghost1372

everything can be handy

ScreenShot

It can be triggered by shortcut keys to save the entire screen or the content of a specified area as a picture.

1
public class Screenshot

Attributes

Property
IsDrawing
IsSelecting
Size
SizeStr
PixelColor
PixelColorStr
PreviewBrush

Method

Name Description
Start() Start screenshot

Events

Name Description
Snapped Triggered when the screenshot is complete

Case

1
new Screenshot().Start();

or

1
<Button Content="Start Screenshot" Command="hc:ControlCommands.StartScreenshot"/>

Snapped

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public partial class ScreenshotDemoCtl : IDisposable
{
public ScreenshotDemoCtl()
{
InitializeComponent();
Screenshot.Snapped += Screenshot_Snapped;
}

private void Screenshot_Snapped(object sender, FunctionEventArgs<ImageSource> e)
{
new HandyControl.Controls.Window
{
Content = new Image
{
Source = e.Info,
Stretch = Stretch.None
},
WindowStartupLocation = WindowStartupLocation.CenterScreen
}.ShowDialog();
}

public void Dispose() => Screenshot.Snapped -= Screenshot_Snapped;
}

Screenshot

0%