我在这个应用程序中开发新闻应用程序在recyclerview中显示视频。所以我想显示视频第一帧(缩略图)图像,这样我就可以在recyclerview中将该图像设置为imageview。
我使用 FFmpegMediaMetadataRetriever ,但我的recyclerview卡住了一段时间然后显示视频缩略图。
还有其他解决办法吗?
这是我的代码
Const StepSize As Integer = 1 '-- increase or decrease this to move the block fast or slow.
Private Random As New Random
Public BulletMovement As System.Drawing.Point
Public bullet_case
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Asteroid1Movement.Interval = 1
Asteroid1Movement.Enabled = True
End Sub
Private Sub Asteroid1Movement_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Asteroid1Movement.Tick
Dim direction As Integer = Random.Next(0, 4)
Select Case direction
Case 0 'Upwards
Asteroid1.Top -= StepSize
If Asteroid1.Top < 0 Then Asteroid1.Top = 0
Case 1 'Downwards
Asteroid1.Top += StepSize
If Asteroid1.Top > Me.Height - Asteroid1.Height Then Asteroid1.Top = Me.Height - Asteroid1.Height
Case 2 'Left
Asteroid1.Left -= StepSize
If Asteroid1.Left < 0 Then Asteroid1.Left = 0
Case 3 'Right
Asteroid1.Left += StepSize
If Asteroid1.Left > Me.Width - Asteroid1.Width Then Asteroid1.Left = Me.Width - Asteroid1.Width
End Select
End Sub