Class CameraService
- Namespace
- Ink_Canvas.Helpers
- Assembly
- InkCanvasForClass.dll
public class CameraService : IDisposable
- Inheritance
-
CameraService
- Implements
- Inherited Members
Constructors
CameraService()
public CameraService()
CameraService(int, int, int)
public CameraService(int rotationAngle, int resolutionWidth, int resolutionHeight)
Parameters
Properties
AvailableCameras
public List<FilterInfo> AvailableCameras { get; }
Property Value
- List<FilterInfo>
CurrentCamera
public FilterInfo CurrentCamera { get; }
Property Value
- FilterInfo
IsCapturing
public bool IsCapturing { get; }
Property Value
ResolutionHeight
public int ResolutionHeight { get; set; }
Property Value
ResolutionWidth
public int ResolutionWidth { get; set; }
Property Value
RotationAngle
public int RotationAngle { get; set; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetCameraNames()
获取摄像头名称列表
public List<string> GetCameraNames()
Returns
GetCurrentFrameAsBitmapSource()
获取当前帧的BitmapSource(WPF格式),直接返回可用的WPF位图
public BitmapSource GetCurrentFrameAsBitmapSource()
Returns
HasAvailableCameras()
检查是否有可用摄像头
public bool HasAvailableCameras()
Returns
RefreshCameraList()
刷新可用摄像头列表
public void RefreshCameraList()
StartPreview(int)
开始摄像头预览
public bool StartPreview(int cameraIndex = 0)
Parameters
cameraIndexint摄像头索引
Returns
StopPreview()
停止摄像头预览
public void StopPreview()
SwitchCamera(int)
切换到指定摄像头
public bool SwitchCamera(int cameraIndex)
Parameters
cameraIndexint摄像头索引
Returns
Events
ErrorOccurred
public event EventHandler<string> ErrorOccurred
Event Type
FrameReceived
public event EventHandler<Bitmap> FrameReceived