当前位置: 首页 > news >正文

安徽网站搭建北京网站建设小鱼在线

安徽网站搭建,北京网站建设小鱼在线,wordpress 双栏主题,wordpress文件上传函数QT- QT-lximagerEidtor图片编辑器 一、演示效果二、关键程序三、下载链接 功能如下#xff1a; 1、缩放、旋转、翻转和调整图像大小 2、幻灯片 3、缩略图栏#xff08;左、上或下#xff09;#xff1b;不同的缩略图大小 4、Exif数据栏 5、内联图像重命名 6、自定义快捷方式… QT- QT-lximagerEidtor图片编辑器 一、演示效果二、关键程序三、下载链接 功能如下 1、缩放、旋转、翻转和调整图像大小 2、幻灯片 3、缩略图栏左、上或下不同的缩略图大小 4、Exif数据栏 5、内联图像重命名 6、自定义快捷方式 7、图像注释箭头、矩形、圆形、数字 8、最近的文件 9、上传图片Imgur 10、截屏 一、演示效果 二、关键程序 using namespace LxImage;static bool hasXFixes() {int event_base, error_base;return XFixesQueryExtension(QX11Info::display(), event_base, error_base); }ScreenshotDialog::ScreenshotDialog(QWidget* parent, Qt::WindowFlags f): QDialog(parent, f), hasXfixes_(hasXFixes()) {ui.setupUi(this);Application* app static_castApplication*(qApp);app-addWindow();if(!hasXfixes_) {ui.includeCursor-hide();} }ScreenshotDialog::~ScreenshotDialog() {Application* app static_castApplication*(qApp);app-removeWindow(); }void ScreenshotDialog::done(int r) {if(r QDialog::Accepted) {hide();QDialog::done(r);XSync(QX11Info::display(), 0); // is this useful?int delay ui.delay-value();if(delay 0) {// NOTE:// Well, we need to give X and the window manager some time to// really hide our own dialog from the screen.// Nobody knows how long it will take, and there is no reliable// way to ensure that. Lets wait for 400 ms here for it.delay 400;}else {delay * 1000;}// the dialog object will be deleted in doScreenshot().QTimer::singleShot(delay, this, SLOT(doScreenshot()));}else {deleteLater();} }QRect ScreenshotDialog::windowFrame(WId wid) {QRect result;XWindowAttributes wa;if(XGetWindowAttributes(QX11Info::display(), wid, wa)) {Window child;int x, y;// translate to root coordinateXTranslateCoordinates(QX11Info::display(), wid, wa.root, 0, 0, x, y, child);//qDebug(%d, %d, %d, %d, x, y, wa.width, wa.height);result.setRect(x, y, wa.width, wa.height);// get the frame widths added by the window managerAtom atom XInternAtom(QX11Info::display(), _NET_FRAME_EXTENTS, false);unsigned long type, resultLen, rest;int format;unsigned char* data nullptr;if(XGetWindowProperty(QX11Info::display(), wid, atom, 0, G_MAXLONG, false,XA_CARDINAL, type, format, resultLen, rest, data) Success) {}if(data) { // left, right, top, bottomlong* offsets reinterpret_castlong*(data);result.setLeft(result.left() - offsets[0]);result.setRight(result.right() offsets[1]);result.setTop(result.top() - offsets[2]);result.setBottom(result.bottom() offsets[3]);XFree(data);}}return result; }WId ScreenshotDialog::activeWindowId() {WId root WId(QX11Info::appRootWindow());Atom atom XInternAtom(QX11Info::display(), _NET_ACTIVE_WINDOW, false);unsigned long type, resultLen, rest;int format;WId result 0;unsigned char* data nullptr;if(XGetWindowProperty(QX11Info::display(), root, atom, 0, 1, false,XA_WINDOW, type, format, resultLen, rest, data) Success) {result *reinterpret_castlong*(data);XFree(data);}return result; }QImage ScreenshotDialog::takeScreenshot(const WId wid, const QRect rect, bool takeCursor) {QImage image;QScreen *screen QGuiApplication::primaryScreen();if(screen) {QPixmap pixmap screen-grabWindow(wid, rect.x(), rect.y(), rect.width(), rect.height());image pixmap.toImage();//call to hasXFixes() maybe executed here from cmd line with no gui mode (some day though, currently ignore cursor)if(takeCursor hasXFixes()) {// capture the cursor if neededXFixesCursorImage* cursor XFixesGetCursorImage(QX11Info::display());if(cursor) {if(cursor-pixels) { // pixles should be an ARGB arrayQImage cursorImage;if(sizeof(long) 4) {// FIXME: will we encounter byte-order problems here?cursorImage QImage((uchar*)cursor-pixels, cursor-width, cursor-height, QImage::Format_ARGB32);}else { // XFixes returns long integers which is not 32 bit on 64 bit systems.long len cursor-width * cursor-height;quint32* buf new quint32[len];for(long i 0; i len; i) {buf[i] (quint32)cursor-pixels[i];}cursorImage QImage((uchar*)buf, cursor-width, cursor-height, QImage::Format_ARGB32, [](void* b) {delete[](quint32*)b;}, buf);}// paint the cursor on the current imageQPainter painter(image);painter.drawImage(cursor-x - cursor-xhot, cursor-y - cursor-yhot, cursorImage);}XFree(cursor);}}}return image; }void ScreenshotDialog::doScreenshot() {WId wid 0;QRect rect{0, 0, -1, -1};wid QApplication::desktop()-winId(); // get desktop windowif(ui.currentWindow-isChecked()) {WId activeWid activeWindowId();if(activeWid) {if(ui.includeFrame-isChecked()) {rect windowFrame(activeWid);}else {wid activeWid;}}}//using stored hasXfixes_ so avoid extra call to function laterQImage image{takeScreenshot(wid, rect, hasXfixes_ ui.includeCursor-isChecked())};if(ui.screenArea-isChecked() !image.isNull()) {ScreenshotSelectArea selectArea(image);if(QDialog::Accepted selectArea.exec()) {image image.copy(selectArea.selectedArea());}}Application* app static_castApplication*(qApp);MainWindow* window app-createWindow();window-resize(app-settings().windowWidth(), app-settings().windowHeight());if(!image.isNull()) {window-pasteImage(image);}window-show();deleteLater(); // destroy ourself }static QString buildNumericFnPart() {//we may have many copies running with no gui, for example user presses hot keys fast//so they must have different file names to save, lets do it time pidconst auto now QDateTime::currentDateTime().toMSecsSinceEpoch();const auto pid getpid();return QStringLiteral(%1_%2).arg(now).arg(pid); }static QString getWindowName(WId wid) {QString result;if(wid) {static const char* atoms[] {WM_NAME,_NET_WM_NAME,STRING,UTF8_STRING,};const auto display QX11Info::display();Atom a None, type;for(const auto c : atoms) {if(None ! (a XInternAtom(display, c, true))) {int form;unsigned long remain, len;unsigned char *list;errno 0;if(XGetWindowProperty(display, wid, a, 0, 1024, False, XA_STRING,type, form, len, remain, list) Success) {if(list *list) {std::string dump((const char*)list);std::stringstream ss;for(const auto sym : dump) {if(std::isalnum(sym)) {ss.put(sym);}}result QString::fromStdString(ss.str());break;}}}}}return (result.isEmpty()) ? QStringLiteral(UNKNOWN) : result; }void ScreenshotDialog::cmdTopShotToDir(QString path) {WId activeWid activeWindowId();const QRect rect (activeWid) ? windowFrame(activeWid) : QRect{0, 0, -1, -1};QImage img{takeScreenshot(QApplication::desktop()-winId(), rect, false)};QDir d;d.mkpath(path);QFileInfo fi(path);if(!fi.exists() || !fi.isDir() || !fi.isWritable()) {path QDir::homePath();}const QString filename QStringLiteral(%1/%2_%3).arg(path).arg(getWindowName(activeWid)).arg(buildNumericFnPart());const auto static png QStringLiteral(.png);QString finalName filename % png;//most unlikelly this will happen ... but user might change system clock or so and we dont want to overwrite filefor(int counter 0; QFile::exists(finalName) counter 5000; counter) {finalName QStringLiteral(%1_%2%3).arg(filename).arg(counter).arg(png);}//std::cout finalName.toStdString() std::endl;img.save(finalName); } 三、下载链接 https://download.csdn.net/download/u013083044/88628914
http://www.tj-hxxt.cn/news/230934.html

相关文章:

  • 大学生网站开发接单全球最大的网站建设外包网
  • 手工艺品外贸公司网站建设方案北京建设工程联合验收网站
  • 怎样做易支付网站太原网站建设制作
  • 徐东做网站凡客官网首页
  • 电白网站开发公司企业官网招聘信息
  • 深圳企业网站公司网站备案号密码找回
  • 营销型手机网站小程序商城哪家好些
  • 站长工具端口网站优化大赛
  • 易语言编程可以做网站么网站你懂我意思正能量免费下载
  • 网站安全狗 拦截301php网站开发都需要什么软件
  • 专业提供网站建设服务包括哪些网上怎么推广公司产品
  • 邯山区建设局网站合肥网站建设开发
  • 湖北省随州市建设厅网站公司的官方网站的作用
  • 德成建设集团有限公司网站孝感市网站建设公司
  • 北京网站建设推广服微信网站程序
  • 国内红酒网站建设长春网络公司营销模式
  • 南京建网站公司wordpress 公司内网
  • 新余网站建设找谁做自己在线制作logo免费广告招牌
  • 外贸邮箱用哪个比较好外链seo推广
  • 无锡自适应网站开发电子商务的就业方向
  • 网站建设实验步骤上海建筑设计院
  • wordpress网站加密wordpress 编辑 所见即所得插件
  • 做投票链接网站西安企业网站怎么建立
  • 百度云服务器挂网站北京网站设计公司有哪些
  • 新的网络推广方式147seo工具
  • 个人网站更换域名代做网站关键词
  • wordpress 影视主题WordPress优化速度插件
  • 网站建站哪家公司好一点wordpress局域网
  • 邯郸哪里有做网站的李桂阳城乡建设局网站
  • 企业建网站好接做网站单子的网站