Add Region Feature to Your Screen Recorder

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
2 posts Page 1 of 1
Contributors
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

First If Your Screen Recorder is the one that takes images and saves as images add this code after publis class form1
Code: Select all
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Dim NewPoint As New System.Drawing.Point()
    Dim X, Y As Integer
    Public Function CaptureImage(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer) As Bitmap
        Dim BMP As New Bitmap(Width, Height)
        Dim G As Graphics = Graphics.FromImage(BMP)
        G.CopyFromScreen(New Point(X, Y), New Point(0, 0), BMP.Size)
        G.Dispose() : Return BMP
    End Function

    Private Sub RecScreen_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RecScreen.Tick
        'The PlayBack Part of the program.
        If CheckBox1.Checked = True = True Then
            Dim DirectoryA As String = FileDir.Text
            Dim Frame0 As String = FileNum.Text
            Dim img0 As String = Filetype.Text
            Try
                FileNum.Text = FileNum.Text + 1
                VideoScreenWindow.VideoScreen.Load(DirectoryA & Frame0 & img0)
            Catch ex As Exception
                RecScreen.Stop()
            End Try


        Else
            'The Recording Part Of the program.
'radio button 1 = region
            If RadioButton1.Checked = True Then
                Dim stirr As Bitmap = CaptureImage(Form2.Location.X, Form2.Location.Y, Form2.ClientSize.Width, Form2.ClientSize.Height)

                Dim DirectoryA As String = FileDir.Text
                Dim Frame1 As String = FileNum.Text
                Dim img1 As String = Filetype.Text
                Try
                    FileNum.Text = FileNum.Text + 1
                    stirr.Save(DirectoryA & Frame1 & img1)
                    PictureBox3.Image = stirr
                Catch ex As Exception
                End Try
                    FileNum.Text = FileNum.Text + 1
                    stirr.Save(DirectoryA & Frame1 & img1)
                    PictureBox3.Image = stirr
                End If
    End Sub



and make a new form called form2

change the properties to look like this
FormBorderStyle = Sizable
TopMost = True
ControlBox = False
Text = ""
transparency color = "white"
forecolor = "red"
backcolor = "white"

now go to code and and write this under public class form2

Code: Select all
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Dim NewPoint As New System.Drawing.Point()
    Dim X, Y As Integer
    Public Function CaptureImage(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer) As Bitmap
        Dim BMP As New Bitmap(Width, Height)
        Dim G As Graphics = Graphics.FromImage(BMP)
        G.CopyFromScreen(New Point(X, Y), New Point(0, 0), BMP.Size)
        G.Dispose() : Return BMP
    End Function

    Private Sub Form2_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
        X = Control.MousePosition.X - Me.Location.X
        Y = Control.MousePosition.Y - Me.Location.Y
    End Sub

    Private Sub Form2_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
        If e.Button = MouseButtons.Left Then
            NewPoint = Control.MousePosition
            NewPoint.X -= (X)
            NewPoint.Y -= (Y)
            Me.Location = NewPoint
        End If
    End Sub

    Private Sub Form2_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.DoubleClick
        Me.Close()
    End Sub

And i have many other features like it shows your mouse and live editing mode the point is i am advanced

i origanly made this for Mtech unfortanly it wasnt working for him so now Mtech just read this and you'll have it except less advanced

Download


http://www.mediafire.com/download.php?h20dgcgn5zt8ela
thats it hope u like
You do not have the required permissions to view the files attached to this post.
Last edited by Bogoh67 on Fri Jul 06, 2012 9:02 pm, edited 5 times in total.
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

can you organize it better i got lost after the first and this
:D
other than that
nice tutorial
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
2 posts Page 1 of 1
Return to “Tutorials”