How to screenshot in Linux

本文介绍了一种在Linux环境下进行屏幕截图的方法。通过简单的命令即可完成截图操作,并提供了具体步骤及实例。对于初学者来说,这是一个非常实用的指南。

 

learn from http://www.linux-noob.com/forums/index.php?/topic/339-how-to-take-a-screenshot-in-linux/

#include "singledbconnect.h" SingleDBConnect * SingleDBConnect::dbConnect=nullptr; SingleDBConnect * SingleDBConnect::getInstance() { if(SingleDBConnect::dbConnect==nullptr) { SingleDBConnect::dbConnect=new SingleDBConnect(); } return SingleDBConnect::dbConnect; } SingleDBConnect::SingleDBConnect() { this->psqlite=nullptr; this->openDatabase("../database/lawCameraDB.db"); } sqlite3 *SingleDBConnect::getPsqlite() const { return this->psqlite; } void SingleDBConnect::openDatabase(const char *path) { sqlite3_open(path,&this->psqlite); // if(this->psqlite==nullptr) // { // int res=sqlite3_open(path,&this->psqlite); // if(res==SQLITE_OK) // { // qDebug()<<"数据库打开成功"; // } // else { // qDebug()<<"数据库打开失败"; // qDebug()<<"错误码 "<<sqlite3_errcode(this->psqlite); // qDebug()<<"错误信息 "<<sqlite3_errmsg(this->psqlite); // } // } } SingleDBConnect::~SingleDBConnect() { sqlite3_close(this->psqlite); // if(this->psqlite!=nullptr) // { // int res=sqlite3_close(this->psqlite); // if(res==SQLITE_OK) // { // qDebug()<<"数据库关闭成功"; // } // else { // qDebug()<<"数据库关闭失败"; // qDebug()<<"错误码 "<<sqlite3_errcode(this->psqlite); // qDebug()<<"错误信息 "<<sqlite3_errmsg(this->psqlite); // return; // } // } } #------------------------------------------------- # # Project created by QtCreator 2025-05-06T13:22:20 # #------------------------------------------------- QT += core gui multimedia multimediawidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = lawCamera TEMPLATE = app # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 CONFIG += c++11 SOURCES += \ main.cpp \ view/turnonwidget.cpp \ db/singledbconnect.cpp \ data/user.cpp \ data/log.cpp \ model/usermodel.cpp \ model/basemodel.cpp \ data/config.cpp \ data/firstframe.cpp \ model/firstframemodel.cpp \ data/screenshot.cpp \ model/screenshotmodel.cpp \ data/video.cpp \ model/videomodel.cpp \ control/mycontrol.cpp \ model/configmodel.cpp \ data/u_v_f.cpp \ model/u_v_fmodel.cpp \ view/myitem.cpp \ view/setwidget.cpp \ view/loginwidget.cpp \ view/verification.cpp \ view/mainwidget.cpp \ threads/decodevideo.cpp \ threads/encodevideo.cpp \ view/photowidget.cpp \ view/imagewin.cpp \ view/videoplaybackselectwidget.cpp \ view/vieoplaybackwidget.cpp \ model/logmodel.cpp \ view/savevideowidget.cpp \ threads/trancevideo.cpp \ view/logwidget.cpp HEADERS += \ view/turnonwidget.h \ db/singledbconnect.h \ data/user.h \ data/log.h \ model/usermodel.h \ model/basemodel.h \ data/config.h \ data/firstframe.h \ model/firstframemodel.h \ data/screenshot.h \ model/screenshotmodel.h \ data/video.h \ model/videomodel.h \ control/mycontrol.h \ model/configmodel.h \ data/u_v_f.h \ model/u_v_fmodel.h \ view/myitem.h \ view/setwidget.h \ view/loginwidget.h \ view/verification.h \ view/mainwidget.h \ threads/decodevideo.h \ threads/encodevideo.h \ view/photowidget.h \ view/imagewin.h \ view/videoplaybackselectwidget.h \ view/vieoplaybackwidget.h \ model/logmodel.h \ view/savevideowidget.h \ threads/trancevideo.h \ view/logwidget.h # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ resources.qrc \ qss.qrc INCLUDEPATH+=$$PWD/ffmpeglib/include LIBS+=$$PWD/ffmpeglib/lib/avcodec.lib \ $$PWD/ffmpeglib/lib/avdevice.lib \ $$PWD/ffmpeglib/lib/avfilter.lib \ $$PWD/ffmpeglib/lib/avformat.lib \ $$PWD/ffmpeglib/lib/avutil.lib \ $$PWD/ffmpeglib/lib/postproc.lib \ $$PWD/ffmpeglib/lib/swresample.lib \ $$PWD/ffmpeglib/lib/swscale.lib \ $$PWD/lib/sqlite3.lib DESTDIR=bin 为什么这里连接数据库的路径是../database/lawCameraDB.db 而. QT += quick CONFIG += c++11 # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Refer to the documentation for the # deprecated API to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ sqlite3/databaseconnect.cpp RESOURCES += qml.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target INCLUDEPATH += D:/QtProject/opencv_3.4.2_Qt/include LIBS += D:/QtProject/opencv_3.4.2_Qt/x86/bin/libopencv_*.dll LIBS += $$PWD/lib/sqlite3.lib HEADERS += \ sqlite3/sqlite3.h \ sqlite3/databaseconnect.h #include "databaseconnect.h" DatabaseConnect* DatabaseConnect::databaseConnect=nullptr; DatabaseConnect* DatabaseConnect::getInstance()//懒汉式单例 { if(DatabaseConnect::databaseConnect == nullptr) { DatabaseConnect::databaseConnect = new DatabaseConnect(); } return DatabaseConnect::databaseConnect; } sqlite3 *DatabaseConnect::getMdb() const { return mdb; } DatabaseConnect::~DatabaseConnect() { if(this->mdb) { sqlite3_close(this->mdb); this->mdb = nullptr; } } DatabaseConnect::DatabaseConnect() { this->mdb = nullptr; //D:/QtProject/OpenCVImageVideoProcessor/database/opencvImageVideoProcessordb.db if(sqlite3_open("./database/opencvImageVideoProcessordb.db",&this->mdb)!=SQLITE_OK) { qDebug()<<sqlite3_errmsg(this->mdb)<<sqlite3_errcode(this->mdb); sqlite3_close(this->mdb); } else { qDebug()<<"数据库连接成功"; } } 这里用的是./database/opencvImageVideoProcessordb.db
最新发布
12-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值