39 lines
997 B
C#
39 lines
997 B
C#
namespace XP.Camera;
|
|
|
|
/// <summary>相机设备信息。</summary>
|
|
public record CameraInfo(
|
|
string ModelName,
|
|
string SerialNumber,
|
|
string VendorName,
|
|
string DeviceType
|
|
);
|
|
|
|
/// <summary>图像采集成功事件参数。</summary>
|
|
public class ImageGrabbedEventArgs : EventArgs
|
|
{
|
|
public byte[] PixelData { get; }
|
|
public int Width { get; }
|
|
public int Height { get; }
|
|
public string PixelFormat { get; }
|
|
|
|
public ImageGrabbedEventArgs(byte[] pixelData, int width, int height, string pixelFormat)
|
|
{
|
|
PixelData = pixelData;
|
|
Width = width;
|
|
Height = height;
|
|
PixelFormat = pixelFormat;
|
|
}
|
|
}
|
|
|
|
/// <summary>图像采集失败事件参数。</summary>
|
|
public class GrabErrorEventArgs : EventArgs
|
|
{
|
|
public int ErrorCode { get; }
|
|
public string ErrorDescription { get; }
|
|
|
|
public GrabErrorEventArgs(int errorCode, string errorDescription)
|
|
{
|
|
ErrorCode = errorCode;
|
|
ErrorDescription = errorDescription;
|
|
}
|
|
} |