Skip to content

Commit 32aebe2

Browse files
authored
feat(HikVision): add CapturePicture function (#7407)
* doc: 增加抓图功能 * chore: bump version 10.0.6
1 parent 61871f2 commit 32aebe2

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<PackageReference Include="BootstrapBlazor.FluentSystemIcon" Version="10.0.0" />
4343
<PackageReference Include="BootstrapBlazor.FontAwesome" Version="10.0.0" />
4444
<PackageReference Include="BootstrapBlazor.Gantt" Version="10.0.0" />
45-
<PackageReference Include="BootstrapBlazor.HikVision" Version="10.0.5" />
45+
<PackageReference Include="BootstrapBlazor.HikVision" Version="10.0.6" />
4646
<PackageReference Include="BootstrapBlazor.Holiday" Version="10.0.0" />
4747
<PackageReference Include="BootstrapBlazor.Html2Image" Version="10.0.0" />
4848
<PackageReference Include="BootstrapBlazor.Html2Pdf" Version="10.0.1" />

src/BootstrapBlazor.Server/Components/Samples/HikVisions.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
<Button OnClick="OnCloseSound" IsDisabled="_closeSoundStatus">
8383
<span>关闭声音</span>
8484
</Button>
85+
<Button OnClick="OnCapture" IsDisabled="_stopRealPlayStatus">
86+
<span>抓图</span>
87+
</Button>
8588
</div>
8689
}
8790
</div>

src/BootstrapBlazor.Server/Components/Samples/HikVisions.razor.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ private async Task OnStartRealPlay()
6767
{
6868
_startRealPlayStatus = true;
6969
_stopRealPlayStatus = true;
70-
_openSoundStatus = false;
71-
_closeSoundStatus = true;
7270
await _hikVision.StartRealPlay(_streamType, _channelId);
7371
}
7472

@@ -111,6 +109,11 @@ private async Task OnCloseSound()
111109
}
112110
}
113111

112+
private async Task OnCapture()
113+
{
114+
await _hikVision.CapturePictureAndDownload();
115+
}
116+
114117
private async Task OnInitedAsync(bool initialized)
115118
{
116119
_inited = initialized;
@@ -176,6 +179,8 @@ private Task OnStartRealPlayedAsync()
176179
{
177180
_startRealPlayStatus = _hikVision.IsRealPlaying;
178181
_stopRealPlayStatus = !_startRealPlayStatus;
182+
_openSoundStatus = false;
183+
_closeSoundStatus = true;
179184
StateHasChanged();
180185
return Task.CompletedTask;
181186
}
@@ -184,6 +189,8 @@ private Task OnStopRealPlayedAsync()
184189
{
185190
_startRealPlayStatus = _hikVision.IsRealPlaying;
186191
_stopRealPlayStatus = !_startRealPlayStatus;
192+
_openSoundStatus = true;
193+
_closeSoundStatus = true;
187194
StateHasChanged();
188195
return Task.CompletedTask;
189196
}

0 commit comments

Comments
 (0)