Commit 026b37a8 authored by 张宏's avatar 张宏

123

parent cf3b74d6
......@@ -141,8 +141,8 @@ class UsbCameraService {
await _controller.openCamera(
deviceId,
request: const CameraRequest(
previewWidth: 640,
previewHeight: 480,
previewWidth: 1280,
previewHeight: 720,
renderMode: RenderMode.opengl,
previewFormat: PreviewFormat.mjpeg,
),
......@@ -171,8 +171,8 @@ class UsbCameraService {
await _controller.openCamera(
deviceId,
request: request ?? const CameraRequest(
previewWidth: 640,
previewHeight: 480,
previewWidth: 1280,
previewHeight: 720,
renderMode: RenderMode.opengl,
previewFormat: PreviewFormat.mjpeg,
),
......
......@@ -47,20 +47,22 @@ class CameraControls extends StatelessWidget {
enabled: true, // 刷新按钮始终可用
),
SizedBox(width: 16.w),
_buildControlButton(
icon: Icons.camera_alt,
onPressed: cameraReady ? onTakePhoto : null,
tooltip: '拍照',
enabled: cameraReady,
),
SizedBox(width: 16.w),
_buildControlButton(
icon: isRecording ? Icons.stop : Icons.videocam,
onPressed: cameraReady ? onToggleRecord : null,
tooltip: isRecording ? '停止录像' : '开始录像',
isActive: isRecording,
enabled: cameraReady,
),
// todo 放大,全屏
// _buildControlButton(
// icon: Icons.camera_alt,
// onPressed: cameraReady ? onTakePhoto : null,
// tooltip: '拍照',
// enabled: cameraReady,
// ),
// SizedBox(width: 16.w),
// _buildControlButton(
// icon: isRecording ? Icons.stop : Icons.videocam,
// onPressed: cameraReady ? onToggleRecord : null,
// tooltip: isRecording ? '停止录像' : '开始录像',
// isActive: isRecording,
// enabled: cameraReady,
// ),
],
);
}
......
......@@ -171,7 +171,10 @@ class _MonitoringScreenState extends State<MonitoringScreen> {
Widget _buildCameraPreview() {
return ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: const UsbCameraPreview(),
child: const AspectRatio(
aspectRatio: 16 / 9,
child: UsbCameraPreview(),
),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment