mirror of
https://github.com/DarthAffe/ScreenCapture.NET.git
synced 2026-11-11 19:36:30 +00:00
Added Updated-events
This commit is contained in:
1 parent
1702415aa0
commit
e6202d88b5
3 files changed
+47
-2
No files matched your search
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using ScreenCapture.Events;
|
||||
using SharpGen.Runtime;
|
||||
using Vortice.Direct3D;
|
||||
using Vortice.Direct3D11;
|
||||
@@ -15,7 +16,7 @@ using Usage = Vortice.Direct3D11.Usage;
|
||||
namespace ScreenCapture
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public class DX11ScreenCapture : IScreenCapture
|
||||
public sealed class DX11ScreenCapture : IScreenCapture
|
||||
{
|
||||
#region Constants
|
||||
|
||||
@@ -51,6 +52,12 @@ namespace ScreenCapture
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler<ScreenCaptureUpdatedEventArgs>? Updated;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public DX11ScreenCapture(IDXGIFactory1 factory, Display display)
|
||||
@@ -120,6 +127,12 @@ namespace ScreenCapture
|
||||
}
|
||||
catch { /**/ }
|
||||
|
||||
try
|
||||
{
|
||||
Updated?.Invoke(this, new ScreenCaptureUpdatedEventArgs(result));
|
||||
}
|
||||
catch { /**/ }
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user