Screen Capturer (ActiveX/COM screen recording API)ByteScout Screen Capturing SDK

Bytescout Screen Capturer ActiveX and .NET API

Bytescout Screen Capturer ActiveX and .NET interface provides set of methods and properties to capture screen into a video and optional screnshots from Visual Basic 6, C#, VB.NET and other programming languages. Simple and easy to use!

General Information

Filename: BytescoutScreenCapturing.dll

ActiveX and .NET object interfaces: BytescoutScreenCapturing.Capturer

BytescoutScreenCapturing.Capturer: GUID = DCAFCA37-546E-4D0A-9C02-D3221E65FCA9. This ActiveX object interface provides ready-to-use methods and properties to capture video (with audio) into .WMV or .AVI files.

  • Type CaptureAreaType - defines the screen recording mode:

    • caRegion = 0, // capture the region defined with rectangle at CaptureRectLeft, CaptureRectTop, CaptureRectWidth, CaptureRectHeight

    • caWindow = 1, // captures the given window (including non-visible(!) windows). See WindowsToCapture and WindowToCapture2 properties to define window to find by its title, class name or window handle). IMPORTANT: may cause flickering on some Windows versions (depends on graphic card as well). You can also crop video capture from window using CaptureRectLeft, CaptureRectTop, CaptureRectWidth, CaptureRectHeight

    • caMouse = 2, // captures the area around the mouse pointer with the width and height defined by CaptureRectWidth and CaptureRectHeight

    • caScreen = 3 // capture entire screen

    • caVisibleWindow = 4 // capture the given window (works for visible windows (only!), for non-visible windows see caWindow(1) mode). See WindowsToCapture and WindowToCapture2 properties to define window to find by its title, class name or window handle). IMPORTANT: may cause flickering on some Windows versions (depends on graphic card as well). You can also crop video capture from window using CaptureRectLeft, CaptureRectTop, CaptureRectWidth, CaptureRectHeight

    • catWebcamFullScreen = 5 // full screen recording from web cam with optional web cam preview

  • Type CaptureAreaBorderType - defines border type drawn around the recording area:

    • cabtNone = 0, // no border is drawn around

    • cabtSolid = 1, // draws a solid line border with color defined in .CaptureAreaBorderColor property

    • cabtDashed = 2, // draws dashed style border with color defined in .CaptureAreaBorderColor property

    • cabtDotted = 3 // draws dotted style border with color defined in .CaptureAreaBorderColor property

  • Type ScreenshotSavingType - defines screenshots capturing mode (screenshots are captured during the recording of the screen video):

    • ssstNone = 0, // do not create screenshots during video recording.

    • ssstOnMouseClick = 1, // makes screenshots on every mouse click and on .TakeScreenshot() method calls.

    • ssstOnTimer = 2, // Create screenshots on timer and on .TakeScreenshot() method calls.

    • ssstManual = 3 // capture screenshots only after calls for .TakeScreenshot() method.

  • Type ScreenshotImageType - defines image format used for screenshots:

    • ssitPng = 0, // PNG image format.

    • ssitBmp = 1, // BMP image format.

  • Property CapturingType As CaptureAreaType: area type to capture;

  • Property CaptureRectLeft As Long: left coordinate of the rectangle to capture from (in .CaptureAreaSource=caRegion(0) mode)

  • Property CaptureRectTop As Long: top coordinate of the rectangle to capture from (in .CaptureAreaSource=caRegion(0) mode)

  • Property CaptureRectWidth As Long: width of the rectangle to capture from (in .CaptureAreaSource=caRegion(0) and .CaptureAreaSource=caMouse(2) modes). In .CaptureAreaSource=caMouse(2) this property defines the width of the rectangle near the mouse cursor

  • Property CaptureRectHeight As Long: height of the rectangle to capture from (in .CaptureAreaSource=caRegion(0) and .CaptureAreaSource=caMouse(2) modes). In .CaptureAreaSource=caMouse(2) this property defines the height of the rectangle near the mouse cursor

  • Property CaptureAreaBorderStyle As CaptureAreaBorderType: defines the style of the border drawn around the recording area (when not capturing entire screen or web camera).

  • Property CaptureAreaBorderWidth As Long: sets the width of the border line drawn around recording area (when border is enabled).

  • Property CaptureAreaBorderColor As OLE_COLOR: sets the color of the border to draw around recording area (when enabled).

  • Property FPS As FLOAT: FPS of the output video;

  • Property Version As String: returns text string with version information;

  • Property UseRegistryKey As String: defines the registry key to store settings. Default value is HKCU\Software\Bytescout\Screen Capturing Filter\

  • Property UseRegistryHive As Long: controls the Windows Registry Hive;

  • Method UseDefaultRegistryKey: resets the filter to use default registry key (HKCU\Software\Bytescout\Screen Capturing Filter\)

  • Property OutputFileName As String: set the output filename with absolute path using this property. For example: c:\tmp\OutputVideo.avi

  • Property WindowToCapture As String: partial name of the window to capture from (in .CaptureAreaSource=caWindow(1) mode). You can provide partial name of the window or partial class name.

  • Property WindowToCapture2 As OLE_HANDLE: window handle of the window to capture from (in .CaptureAreaSource=caWindow(1) mode).

  • Property WindowClassToCapture As String: window class name template to find the the window to capture from (in .CaptureAreaSource=caWindow(1) mode).

  • Property CropEnabled As Boolean: enables the optional cropping of the output video .

  • Property CropRectLeft As Long: sets the left for the cropping.

  • Property CropRectTop As Long: sets the top for the cropping.

  • Property CropRectWidth As Long: sets the width for the cropping.

  • Property CropRectHeight As Long: sets the height for the cropping.

  • Property WindowToCaptureIsAvailable As Boolean: returns True if window to capture (defined by .WindowClassToCapture, .WindowToCapture2, .WindowToCapture properties) is currently available for recording from. If you are recording from another application then you can use this property to check if the application is running or not.

  • Method Run: use this method to run screen capturing.

  • Method Stop: use this method to stop screen capturing. You can also stop capturing by destroying Capturer object.

  • Property IsRunning As Boolean: returns True if recording is currently running.

  • Method SetLogFile(FileName as String): use this method to set path to the log filename.

  • Property EndBufferDuration As Long: sets the duration of the end recording buffer in milliseconds. This duration is how much time is actually recorded after the call for Stop() method. Zero by default.

  • Method SetFullPreviewContext(LONG_PTR hdc, Left As Long, Top As Long, Width As Long, Height As Long): sets the HDC to draw the preview based on the final video. Can be used to draw a preview of the recording video on the custom window in your application.

  • Property IsLastPreviewDrawingSuccessful As Boolean: returns True if last preview drawn to HDC (set by SetFullPreviewContext method) was successful and False otherwise.

  • Property AddWebCam As Bool: enable/disable overlay from web camera;

  • Method SetWebCamVideoRectangle(Left As Long, Top As Long, Width As Long, Height As Long): sets the rectangle to draw video overlay from web camera on the main video;

  • Method SetWebCamPreviewContext(LONG_PTR hdc, Left As Long, Top As Long, Width As Long, Height As Long): sets the HDC to draw preview from web cam. Can be used to draw a preview from webcamera on the custom window in your application.

  • Property WebCamCount As Long returns number of available web camera devices;

  • Method GetWebCamName (Index As Long) As String: returns full name of web camera device by its index;

  • Property CurrentWebCamAs Long: read or write currently selected web camera device by its index;

  • Property CurrentWebCamNameAs String: read or write currently selected web camera device by its name;

  • Property OverlayingRedTextCaption As String: read write text to draw as a red color text overlay on the video (this is useful if you want to prevent the video from copying);

  • Method Mute mutes audio recording;

  • Method UnMute unmutes audio recording;

  • Property TemporaryFolder As String: path to temporary folder (used to store video files temporary when .Pause() or JoinWMVFiles() or JoingAVIFiles() methods are used. Set to Windows default temporary folder by default.

  • Property CaptureTransparentControls As Boolean: set to True to enable recording of semitransparent controls and windows. Attention: this may cause mouse cursoe flickering on some Windows configurations. False by default.

  • Method BlackoutAddArea(Left as Long, Top As Long, width as Long, Height as Long): adds the area to blackout on the output video. Call it with multiple areas to add multiple blackout areas.

  • Method BlackoutReset: resets all blackout regions;

  • Method BlackoutSetColor(OLE_COLOR color) sets color for the blackout ares (Black by default);

  • Read-only Property VideoCodecsCount As Long: returns number of available video compression codecs installed on the current computer.

  • Method GetVideoCodecName(Index As Long) As String: returns name of the video codec selected by the index.

  • Property CurrentVideoCodec As Long: set or get currently selected video compression codec (which is used to compress captured video).

  • Property CurrentVideoCodecName As String: set or get currently selected video compression codec using video codec name (which is used to compress captured video).

  • Method JoinAVIFiles(aviFilename1 As string, aviFileName2 as String, OutputFilename As String): joins AVI files (should be the same width, height and FPS) into a single one.

  • Property WMVVideoCodecsCount AS Long: returns number of available WMV video codecs installed on the current computer;

  • Method GetWMVVideoCodecName(Index As Long): returns the name of the WMV video codec by its index in the available video codecs list;

  • Property CurrentWMVVideoCodec As Long: read or write the index of the currently selected WMV codec in the list of available video codecs;

  • Property CurrentWMVVideoCodecName As String: read or write currently selected WMV video codec by its name;

  • Property WMVVideoBitrate As Long: WMV video codec bitrate;

  • Property WMVProfileFile As String: set optional WMV profile filename to load WMV encoding properties;

  • Method JoinWMVFiles(wmvFilename1 As string, wmvFileName2 as String, OutputFilename As String): joins WMV files (should be the same width, height and FPS) into a single one.

  • Property AudioEnabled As Boolean: enable or disable audio recording. True (audio recording is enabled) by default.

  • Read-only Property AudioCodecsCount As Long: returns number of available AVI audio compression codecs installed on the current computer.

  • Method GetAudioCodecName(Index As Long) As String: returns name of the AVI audio codec selected by the index.

  • Property CurrentAudioCodec As Long: set or get currently selected AVI audio compression codec (which is used to compress audio in the captured video).

  • Property CurrentAudioCodecName As String: set or get currently selected AVI audio compression codec using audio codec name (which is used to compress audio in the captured video).

  • Read-only Property WMVAudioCodecsCount As Long: returns number of available WMV audio compression codecs installed on the current computer.

  • Method GetWMVAudioCodecName(Index As Long) As String: returns name of the WMV audio codec selected by the index.

  • Property CurrentWMVAudioCodec As Long: set or get currently selected WMV audio compression codec (which is used to compress audio in the captured video).

  • Property CurrentWMVAudioCodecName As String: set or get currently selected WMV audio compression codec using audio codec name (which is used to compress audio in the captured video).

  • Property WMVAudioFormatCount As Long: get number of available WMV audio codec audio formats;

  • Property CurrentWMVAudioFormat As Long: set or get currently selected WMV audio compression codec audio format;

  • Method GetWMVAudioFormatDescription(Index as Long) As String: returns description for the WMV audio format by its index;

  • Read-only Property AudioDeviceCount As Long: returns number of available audio devices installed on the current computer.

  • Method GetAudioDeviceName(Index As Long) As String: returns name of the audio device selected by the index.

  • Property CurrentAudioDevice As Long: set or get currently selected audio device (which is used to recird audio from in the captured video).

  • Property CurrentAudioDeviceName As String: set or get currently selected device line using audio line name (which is used to record audio from in the captured video).

  • Read-only Property AudioDeviceLinesCount As Long: returns number of available audio lines installed on the current computer.

  • Method GetAudioDeviceLineName(Index As Long) As String: returns name of the audio line selected by the index.

  • Property CurrentAudioDeviceLine As Long: set or get currently selected audio line (which is used to recird audio from in the captured video).

  • Property CurrentAudioDeviceLineName As String: set or get currently selected audio line using audio line name (which is used to record audio from in the captured video).

  • Read-only Property LastError As String: returns description of the last error. Returns empty string in case of no errors.

  • Property RegistrationName As String: set Registration Name to unlock Full version;

  • Property RegistrationKey As String: set Registration Key to unlock Full version;

  • Property OutputWidth As Long: output video width

  • Property OutputHeight As Long: output video height

  • Property MatchOutputSizeToTheSourceSize As Boolean: controls if filter should resize source video into output width and height. True by default.

  • Method ShowCaptureFilterPropertiesDialog As Boolean: show filter properties dialog (if you want user to adjust properties manually). Returns True if user clicked OK and False if user clicks Cancel.

  • Property CaptureMouseCursor As Boolean: controls if filter should record mouse cursor in the video. True by default.

  • Property AnimateMouseButtons As Boolean: controls if filter should display a small animation to indicate which mouse button has been clicked by user. False by default

  • Property AnimateMouseClicks As Boolean:controls if filter should display a small animation (animated circles) when user clicks using the mouse in the output video. True by default.

  • Property MonitorCount As Integer: returns number of monitors available in the system.

  • Property MonitorIndex As Integer: set or get the index of the monitor currently used to record from. -1 by default (record from the whole desktop made of all monitors).

  • Property MonitorLeft As Integer: returns the left coordinate of the currently selected monitor.

  • Property MonitorTop As Integer: returns the top coordinate of the currently selected monitor.

  • Property MonitorRight As Integer: returns the right coordinate of the currently selected monitor.

  • Property MonitorBottom As Integer: returns the bottom coordinate of the currently selected monitor.

  • Property MouseCursorLeftClickAnimationColor As OLE_COLOR: defines the color of the animation for left mouse button clicks. Default color is Blue.

  • Property MouseCursorRightClickAnimationColor As OLE_COLOR: defines the color of the animation for right mouse button clicks. Default color is Green.

  • Property MouseCursorLeftClickAnimationColor As OLE_COLOR: defines the color of the animation for left mouse button clicks. Default color is Blue.

  • Property MouseAnimationDuration As OLE_COLOR: defines the duration of the animation for mouse button clicks. Default duration is 1000 ms (1 sec).

  • Property ShowMouseHotSpot As Boolean: show/hide the semitrasnparent hotspot around the mouse cursor (to make it easier to follow the mouse on the output video). True by default.

  • Property MouseHotSpotColor As OLE_COLOR: color of the hotspot around the mouse. Default is Yellow.

  • Property ScreenshotSavingType as ScreenshotSavingType: sets screenshot saving type (see ScreenshotSavingType enum for more details).

  • Property ScreenshotImageFormat as ScreenshotImageType: sets screenshot image format type (see ScreenshotImageType enum for more details).

  • Property ScreenshotOutputFolder as String: sets the output folder to save screenshots into.

  • Property ScreenshotTimerPeriod as Long: sets the timer period (in milliseconds) to automatically save screenshots (with sstTimer mode set in ScreenshotSavingType property).

  • Method TakeScreenshot(path as String): takes screenshot and saves into the given filename immediately. Can be used while recording is running.

  • Method AddTextOverlay(left as Long, top As Long, text As String, fontName as String, fontSize as Long, isBold As Boolean, isItalic as Boolean, isUnderline as Boolean, color as Color): adds the text overlay to the output video (starting from the current time when the method is called in the runtime). Can be used while recording is running.

  • Method AddTextOverlay2(left as Long, top As Long, text As String, fontName as String, fontSize as Long, isBold As Boolean, isItalic as Boolean, isUnderline as Boolean, R as Byte, G as Byte, B as Byte, A as Byte): adds the text overlay to the output video (starting from the current time when the method is called in the runtime). This method provides a way to set the semitransparent RGBA color. Can be used while recording is running.

  • Method AddTextOverlayWithBackground(left as Long, top As Long, text As String, fontName as String, fontSize as Long, isBold As Boolean, isItalic as Boolean, isUnderline as Boolean, color as Color, backColor): adds the text overlay with background color (for example, white text color on red background color) to the output video (starting from the current time when the method is called in the runtime). Can be used while recording is running.

  • Method AddTextOverlayWithBackground(left as Long, top As Long, text As String, fontName as String, fontSize as Long, isBold As Boolean, isItalic as Boolean, isUnderline as Boolean, R as Byte, G as Byte, B as Byte, A as Byte, BR as Byte, BG as Byte, BB as Byte, BA as Byte): adds the RGBA colored text overlay with RGBA background color (for example, white text color on red background color) to the output video (starting from the current time when the method is called in the runtime). Can be used while recording is running.

  • Method AddImageOverlay(left as Long, top As Long, fileName as String): adds the image overlay to the output video (starting from the current time when the method is called in the runtime). BMP, PNG, semintransparent PNG images are supported. Can be used while recording is running.

  • Method GetOverlayCount as Long: returns the number of current text and image overlay added to the video. Can be used while recording is running.

  • Method RemoveOverlay(index as Long): removes the overlay by its index. Can be used while recording is running.

  • Method UpdateTextOverlay(index as Long, text As String): updates the text in the text overlay by its index. Can be used while recording video.

  • Method UpdateOverlayPosition(index as Long, left As Long, top as Long): updates the position of the overlay on the screen. Can be used while recording video.

  • Method UpdateOverlayVisibility(index as Long, newState as Boolean): updates the visibility of the overlay by its index. Can be used while recording video.

  • Method ClearOverlays() removes all overlays. Can be used while recording video.

VB
Imports System.Threading
Imports System.Diagnostics

Imports BytescoutScreenCapturingLib ' import bytescout screen capturer activex object

Module Module1

    Sub Main()
    ' create capturer class
        Dim capturer As New CapturerClass()
    ' set capturing area to the region type (to capture from given region on the screen)
        capturer.CapturingType = CaptureAreaType.catScreen
    ' output video filename
        capturer.OutputFileName = "EntireScreenCaptured.wmv" ' set output video filename to .WMV or .AVI file


        ' set width and height of output video
        capturer.OutputWidth = 640
        capturer.OutputHeight = 480

      ' 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"            

        ' start capturing
        capturer.Run()

        ' wait for 25 seconds
        Thread.Sleep(25000)

        ' stop capturing and flush WMV or AVI video file into the disk
        capturer.Stop()

        ' open the output video 
        Process.Start("EntireScreenCaptured.wmv")

    End Sub

End Module