ByteScout Screen Capturing SDK – C++ (unmanaged) – Capture From Entire Screen (QT)

  • Home
  • /
  • Articles
  • /
  • ByteScout Screen Capturing SDK – C++ (unmanaged) – Capture From Entire Screen (QT)

ByteScout Screen Capturing SDK – C++ (unmanaged) – Capture From Entire Screen (QT)


#include "widget.h"
#include <QApplication>

int main(int argc, char *argv[])
    QApplication a(argc, argv);
    Widget w;
   //; Decomment if you need custom the GUI

    return a.exec();


#include “widget.h”
#include “ui_widget.h”

using namespace std;

Widget::Widget(QWidget *parent) :
ui(new Ui::Widget)
//Decomment if you need to use QAxWidget
//com = new QAxWidget;
//Comment if you need QAxWidget
com = new QAxObject;
QString error = com->property(“LastError”).toString();
if (“No errors.”)!=0) // or empty string
cout <<"Screen Capturer is not installed properly. " << error.toStdString() << endl; exit(1); } com->setProperty(“RegistrationName”,”demo”);
com->setProperty(“CapturingType”,3);//catScreen: Capture all screen

* The code you sent me used the webcam too.
* Decomment if you need show webcam streaming

// Set rectangle to show overlaying video from webcam into the rectangle 160×120 (starting with left point at 10, 10)
//com->dynamicCall(“SetWebCamVideoRectangle(int,int,int,int)”,10, 10, 160, 120);
// Enable webcam overlaying capture device

//End webcam property

// Set output file name
com->setProperty(“OutputFileName”, “Output.wmv”);

//’ 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

error = com->property(“LastError”).toString();
if (“No errors.”)!=0)
cout <<"Capture failed. " << error.toStdString() << endl; exit(1); } //Testing purposes: //Register for 10 seconds and after stop the process //You can stop the registration as you prefer: Input, keyboard and so on.. Sleep(10000); //Usefull for testing purposes: Register for 10 seconds com->dynamicCall(“Stop()”); //End registration
qDebug()<<"End Registration"; } Widget::~Widget() { delete ui; } [/cpp]

  Click here to get your Free Trial version of the SDK