Page 1 of 1

help save videos as avi

Posted: Mon Jul 05, 2010 11:58 am
by alc955
Code: Select all
Imports System.IO

Public Class Form1
Dim Screen As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim Screensize As New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim G As Graphics = Graphics.FromImage(Screen)
Dim Stream As New FileStream("C:\videofile.avi", FileMode.Append)



Private Sub TmrCapture_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TmrCapture.Tick

G.CopyFromScreen(New Point, New Point, Screensize)
Screen.Save(Stream, Imaging.ImageFormat.Bmp)
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim ff As New FolderBrowserDialog
If (ff.ShowDialog = DialogResult.OK) Then
TextBox1.Text = ff.SelectedPath + "\"
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TmrCapture.Start()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TmrCapture.Stop()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
AxWindowsMediaPlayer1.URL = "c:\test.avi"
End Sub
End Class
i found this codes but didnt work :S
what is the problem S:

Re: help save videos as avi

Posted: Mon Jul 05, 2010 12:40 pm
by mandai
AVI files need more than just bitmap data.

See http://www.alexander-noe.com/video/docu ... on/avi.pdf

Re: help save videos as avi

Posted: Mon Jul 05, 2010 8:18 pm
by alc955
this pdf file's code isnt for VB it is for C#
i am trying make it in VB

Re: help save videos as avi

Posted: Mon Jul 05, 2010 9:05 pm
by mandai
In fact with types like DWORD it looks more closely related to C++, though you should be able to translate it and use the equivilent types.