Sample source code below will show you how to cope with a difficult task like record screen video from given region in VB.NET. ByteScout Screen Capturing SDK can record screen video from given region. It can be used from VB.NET. ByteScout Screen Capturing SDK is the screen video recording SDK helps in quick implementation of screen video recording. WMV, AVI, WebM output options are available with adjustable quality, video size, framerate and video and audio codec. Includes special features like live multiple blacking out of selected areas, recording from web cam as main source and as overlay, optional watermarks for output video.
VB.NET code samples for VB.NET developers help to speed up coding of your application when using ByteScout Screen Capturing SDK. Follow the instructions from the scratch to work and copy the VB.NET code. Implementing VB.NET application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.
You can download free trial version of ByteScout Screen Capturing SDK from our website to see and try many others source code samples for VB.NET.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
Imports System.Threading Imports System.Diagnostics Imports BytescoutScreenCapturingLib ' import bytescout screen capturer activex object ' NOTE: if you are getting error like "invalid image" related to loading the SDK's dll then ' try to do the following: ' 1) remove the reference to the SDK by View - Solution Explorer ' then click on References, select Bytescout... reference name and right-click it and select Remove ' 2) To re-add click on the menu: Project - Add Reference ' 3) In "Add Reference" dialog switch to "COM" tab and find Bytescout... ' 4) Select it and click "Add" ' 5) Recompile the application ' Note: if you need to run on both x64 and x86 then please make sure you have set "Embed Interop Types" to True for this reference Module Module1 Sub Main() ' create capturer class Dim capturer As New Capturer() ' set capturing area to the region type (to capture from given region on the screen) capturer.CapturingType = CaptureAreaType.catRegion ' output video filename capturer.OutputFileName = "GivenRegionCaptured.wmv" ' set output video filename to .WMV or .AVI file ' set coordinates of the region to capture video from capturer.CaptureRectLeft = 50 capturer.CaptureRectTop = 50 capturer.CaptureRectWidth = 640 capturer.CaptureRectHeight = 480 ' // WMV and WEBM output use WMVVideoBitrate property to control output video bitrate ' // so try to increase it by x2 or x3 times if you think the output video are you are getting is laggy ' capturer.WMVVideoBitrate = capturer.WMVVideoBitrate * 2 ' set width and height of output video capturer.OutputWidth = 640 capturer.OutputHeight = 480 ' set border style capturer.CaptureAreaBorderType = CaptureAreaBorderType.cabtDashed ' uncomment to set Bytescout Lossless Video format output video compression method ' do not forget to set file to .avi format if you use Video Codec Name ' capturer.CurrentVideoCodecName = "Bytescout Lossless" ' uncomment to enable recording of semitransparent or layered windows (Warning: may cause mouse cursor flickering) ' capturer.CaptureTransparentControls = true ' start capturing capturer.Run() '// IMPORTANT: if you want to check for some code if need to stop the recording then make sure you are '// using Thread.Sleep(1) inside the checking loop, so you have the loop like '// Do { '// Thread.Sleep(1) '// } '// While(StopButtonNotClicked); Console.WriteLine("Capturing entire screen for 15 seconds...") ' wait for 15 seconds Thread.Sleep(15000) ' stop capturing and flush WMV or AVI video file into the disk capturer.Stop() ' Release(Resources) System.Runtime.InteropServices.Marshal.ReleaseComObject(capturer) capturer = Nothing Console.WriteLine("Done.") ' open the output video Process.Start("GivenRegionCaptured.wmv") End Sub End Module
60 Day Free Trial or Visit ByteScout Screen Capturing SDK Home Page
Explore ByteScout Screen Capturing SDK Documentation
Explore Samples
Sign Up for ByteScout Screen Capturing SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Screen Capturing SDK Home Page
Explore ByteScout Screen Capturing SDK Documentation
Explore Samples
Sign Up for ByteScout Screen Capturing SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples