mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-19 08:19:48 +08:00
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Vision.WindowCapture
|
|
{
|
|
public enum CaptureMode
|
|
{
|
|
BitBlt,
|
|
WindowsGraphicsCapture
|
|
}
|
|
|
|
public static class CaptureModeExtensions
|
|
{
|
|
public static CaptureMode ToCaptureMode(this string modeName)
|
|
{
|
|
return (CaptureMode) Enum.Parse(typeof(CaptureMode), modeName);
|
|
}
|
|
}
|
|
|
|
public class WindowCaptureFactory
|
|
{
|
|
public static string[] ModeNames()
|
|
{
|
|
return Enum.GetNames(typeof(CaptureMode));
|
|
}
|
|
|
|
|
|
public static IWindowCapture Create(CaptureMode mode)
|
|
{
|
|
switch (mode)
|
|
{
|
|
case CaptureMode.BitBlt:
|
|
return new BitBlt.BitBltCapture();
|
|
case CaptureMode.WindowsGraphicsCapture:
|
|
return new GraphicsCapture.GraphicsCapture();
|
|
default:
|
|
throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
|
|
}
|
|
}
|
|
}
|
|
}
|