Tags:
c#
visual-basic
screen-capture
Hvordan kan jeg få Microsoft Expression Encoder 4 i Visual Basic eller C# til at optage skærmen i wmv eller mp4 video?.
Jeg har prøvet med Microsoft.Expression.Encoder.ScreenCapture.ScreenCaptureJob, men den optager i Microsoft Expression Encoder Screen Capture format og ikke i wmv eller mp4 format.
Her er min kode:
Dim capturerec As New Microsoft.Expression.Encoder.ScreenCapture.ScreenCaptureJob
Dim videopath As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\strandboscrrec.wmv"
Dim audiodevices As System.Collections.ObjectModel.Collection(Of Microsoft.Expression.Encoder.Devices.EncoderDevice) = Microsoft.Expression.Encoder.Devices.EncoderDevices.FindDevices(Microsoft.Expression.Encoder.Devices.EncoderDeviceType.Audio)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
capturerec.ScreenCaptureVideoProfile.Quality = 100
capturerec.OutputScreenCaptureFileName = videopath
End Sub
Private Sub Rec_Click(sender As Object, e As EventArgs) Handles Rec.Click
capturerec.ResetSettings()
Select Case True
Case FrameRate15.Checked
capturerec.ScreenCaptureVideoProfile.FrameRate = 15
Case FrameRate20.Checked
capturerec.ScreenCaptureVideoProfile.FrameRate = 20
Case FrameRate25.Checked
capturerec.ScreenCaptureVideoProfile.FrameRate = 25
End Select
Dim audiodevices As System.Collections.ObjectModel.Collection(Of Microsoft.Expression.Encoder.Devices.EncoderDevice) = Microsoft.Expression.Encoder.Devices.EncoderDevices.FindDevices(Microsoft.Expression.Encoder.Devices.EncoderDeviceType.Audio)
For Each item As String In CheckedListBox1.CheckedItems
Select Case item
Case "Microphone"
capturerec.AddAudioDeviceSource(audiodevices(0))
Case "Stereomix"
capturerec.AddAudioDeviceSource(audiodevices(1))
End Select
Next
If System.IO.File.Exists(videopath) Then
System.IO.File.Delete(videopath)
End If
capturerec.Start()
Rec.Enabled = False
CheckedListBox1.Enabled = False
FrameRate15.Enabled = False
FrameRate20.Enabled = False
FrameRate25.Enabled = False
End Sub
Private Sub StopB_Click(sender As Object, e As EventArgs) Handles StopB.Click
capturerec.Stop()
Process.Start(videopath)
End Sub