diff --git a/HTYPaint b/HTYPaint index fc21beb..e5ed39e 100644 Binary files a/HTYPaint and b/HTYPaint differ diff --git a/README.md b/README.md index 506b752..6f649bc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ 已编译好的 HTYPaint 程序适用于 64 位 Linux 系统 Qt5 环境,双击运行,其他版本自行编译。 ![alt](preview.png) - +### 1.10 新增选区马赛克 +![alt](mosaic.png) ### 1.7 新增箭头工具,颜色透明工具 ### 1.4 新增绘制透明图形 ### 1.3 新增模糊 diff --git a/blur.jpg b/blur.jpg index cfff40e..efd310c 100644 Binary files a/blur.jpg and b/blur.jpg differ diff --git a/gray.png b/gray.png index a1654ac..10a85a1 100644 Binary files a/gray.png and b/gray.png differ diff --git a/imagewidget.cpp b/imagewidget.cpp index 12e8e34..3f99a18 100644 --- a/imagewidget.cpp +++ b/imagewidget.cpp @@ -671,7 +671,7 @@ void ImageWidget::transparent() h = imgtemp.height(); QImage imgTansparent(w,h,QImage::Format_ARGB32); for(int x=0; xendPnt.x() && startPnt.y()endPnt.x() && startPnt.y()>endPnt.y()){xs=endPnt.x(); ys=endPnt.y(); xe=startPnt.x(); ye=startPnt.y();} if(startPnt.x()endPnt.y()){xs=startPnt.x(); ys=endPnt.y(); xe=endPnt.x(); ye=startPnt.y();} - QImage imgBlur(qAbs(endPnt.x()-startPnt.x())+2,qAbs(endPnt.y()-startPnt.y())+2,QImage::Format_RGB32); + QImage imgBlur(qAbs(endPnt.x()-startPnt.x())+2, qAbs(endPnt.y()-startPnt.y())+2, QImage::Format_RGB32); for(int x=xs; xendPnt.x() && startPnt.y()endPnt.x() && startPnt.y()>endPnt.y()){xs=endPnt.x(); ys=endPnt.y(); xe=startPnt.x(); ye=startPnt.y();} + if(startPnt.x()endPnt.y()){xs=startPnt.x(); ys=endPnt.y(); xe=endPnt.x(); ye=startPnt.y();} + QImage imgMosaic(qAbs(endPnt.x()-startPnt.x())+2, qAbs(endPnt.y()-startPnt.y())+2, QImage::Format_RGB32); + QPainter painterm(&imgMosaic); + for(int x=xs; xwidget()->setMinimumSize(600,500); setCentralWidget(scrollArea); - ui->action_new->setIcon(style()->standardIcon(QStyle::SP_FileDialogNewFolder)); - ui->action_open->setIcon(style()->standardIcon(QStyle::SP_DialogOpenButton)); - ui->action_save->setIcon(style()->standardIcon(QStyle::SP_DialogSaveButton)); - ui->action_quit->setIcon(style()->standardIcon(QStyle::SP_DialogCloseButton)); - ui->action_undo->setIcon(style()->standardIcon(QStyle::SP_DialogCancelButton)); - ui->action_quit->setIcon(style()->standardIcon(QStyle::SP_DialogCloseButton)); - ui->action_setWallpaper->setIcon(style()->standardIcon(QStyle::SP_ComputerIcon)); - ui->action_about->setIcon(style()->standardIcon(QStyle::SP_DialogHelpButton)); - btnColorBorder = new QToolButton(this); btnColorBorder->setText("□"); btnColorBorder->setToolTip("边框"); @@ -147,7 +138,7 @@ void MainWindow::resizeEvent(QResizeEvent *event) void MainWindow::on_action_changelog_triggered() { - QString s = "1.9\n(2018-11)\n增加:画笔粗细快捷键,画图更加方便。\n\n1.8\n(2018-05)\n修复:删除选区有虚线框,从右键打开方式无法打开文件。\n\n1.7\n(2017-11)\n颜色透明工具,取色后在边框色、填充色显示,超出边界清空鼠标位置信息。\n增加灰色背景,凸显绘图区域。\n优化代码。\n(2017-10)\n简化工具信号,简化setCursor()。\n(2017-09)\n增加箭头工具。\n增加抗锯齿。\n\n1.6\n(2017-07)\n更新日志消息窗口写不下了,改成带滚动条的文本框。\n自定义信号结合事件过滤器,把鼠标移动位置发送到主窗体信息栏。\n增加拖放打开文件。\n(2017-06)\n使用自定义信号解决子类发信息给主窗体状态栏问题,致谢rekols。\n(2017-05)\n右键打开文件记忆文件路径。\n\n1.5 (2017-04)\n透明色反色不改变。\n增加取色工具,橡皮擦颜色不再固定为白色,而是填充色。\n\n1.4 (2017-03)\n支持命令行打开文件和打开方式打开文件。\n修复鼠标指针引用本地文件,没引用资源文件,引起启动path参数改变不能加载图标的问题。\n菜单的SIGNAL-SLOT改为on_action_triggered()\n修复PNG图片裁剪丢失透明度问题。\n新建图像为透明图像。\n\n1.3 (2017-03)\n实现选区模糊。\n加入模糊滤镜。\n\n1.2 (2017-02)\n文件名显示在窗口标题栏。\n区别保存和另存为。\n增加导入图片。\n\n1.1 (2017-01)\n新增灰度、反色。\n\n1.0 (2017-01)\n解决删除选区后画不出选框的问题。\n恢复撤销。\n增加全选。\n实现选区或剪贴板移动!\n保存时自动获取打开文件的路径。\n增加按像素、比例缩放。\n实现在属性窗口设置画布大小。\n2016-12\n增加快捷键控制选框及其边框移动。\n绘图代码从MainWindow向imageWidget迁移。\n实现水平镜像、垂直镜像。\n实现放大、缩小、原始大小。\n为了增加滚动条,增加自定义imageWidget。\n状态栏显示绘图详情。\n复制选区到系统剪贴板,从系统剪贴板获取图像粘贴。\n优化颜色选择交互。\n增加撤销、重做功能,有BUG。\n设为壁纸。\n画选区,剪裁选区。\n新建图片,打开图片,保存图片。\n实现画点、线、框、圆、字。"; + QString s = "1.10\n(2018-12)\n增加:选区马赛克。\n\n1.9\n(2018-11)\n增加:画笔粗细快捷键,画图更加方便。\n\n1.8\n(2018-05)\n修复:删除选区有虚线框,从右键打开方式无法打开文件。\n\n1.7\n(2017-11)\n颜色透明工具,取色后在边框色、填充色显示,超出边界清空鼠标位置信息。\n增加灰色背景,凸显绘图区域。\n优化代码。\n(2017-10)\n简化工具信号,简化setCursor()。\n(2017-09)\n增加箭头工具。\n增加抗锯齿。\n\n1.6\n(2017-07)\n更新日志消息窗口写不下了,改成带滚动条的文本框。\n自定义信号结合事件过滤器,把鼠标移动位置发送到主窗体信息栏。\n增加拖放打开文件。\n(2017-06)\n使用自定义信号解决子类发信息给主窗体状态栏问题,致谢rekols。\n(2017-05)\n右键打开文件记忆文件路径。\n\n1.5 (2017-04)\n透明色反色不改变。\n增加取色工具,橡皮擦颜色不再固定为白色,而是填充色。\n\n1.4 (2017-03)\n支持命令行打开文件和打开方式打开文件。\n修复鼠标指针引用本地文件,没引用资源文件,引起启动path参数改变不能加载图标的问题。\n菜单的SIGNAL-SLOT改为on_action_triggered()\n修复PNG图片裁剪丢失透明度问题。\n新建图像为透明图像。\n\n1.3 (2017-03)\n实现选区模糊。\n加入模糊滤镜。\n\n1.2 (2017-02)\n文件名显示在窗口标题栏。\n区别保存和另存为。\n增加导入图片。\n\n1.1 (2017-01)\n新增灰度、反色。\n\n1.0 (2017-01)\n解决删除选区后画不出选框的问题。\n恢复撤销。\n增加全选。\n实现选区或剪贴板移动!\n保存时自动获取打开文件的路径。\n增加按像素、比例缩放。\n实现在属性窗口设置画布大小。\n2016-12\n增加快捷键控制选框及其边框移动。\n绘图代码从MainWindow向imageWidget迁移。\n实现水平镜像、垂直镜像。\n实现放大、缩小、原始大小。\n为了增加滚动条,增加自定义imageWidget。\n状态栏显示绘图详情。\n复制选区到系统剪贴板,从系统剪贴板获取图像粘贴。\n优化颜色选择交互。\n增加撤销、重做功能,有BUG。\n设为壁纸。\n画选区,剪裁选区。\n新建图片,打开图片,保存图片。\n实现画点、线、框、圆、字。"; QDialog *dialog = new QDialog; dialog->setWindowTitle("更新历史"); dialog->setFixedSize(400,300); @@ -517,6 +508,11 @@ void MainWindow::on_action_blur_triggered() imageWidget->blur(spinbox->value()); } +void MainWindow::on_action_mosaic_triggered() +{ + imageWidget->mosaic(spinbox->value()); +} + void MainWindow::dragEnterEvent(QDragEnterEvent *e) { //if(e->mimeData()->hasFormat("text/uri-list")) //只能打开文本文件 diff --git a/mainwindow.h b/mainwindow.h index 4238a4f..f96de39 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -49,7 +49,6 @@ private slots: void on_action_changelog_triggered(); void on_action_aboutQt_triggered(); void on_action_about_triggered(); - void on_action_undo_triggered(); void on_action_redo_triggered(); void on_action_copy_triggered(); @@ -61,12 +60,15 @@ private slots: void on_action_gray_triggered(); void on_action_invert_triggered(); void on_action_blur_triggered(); + void on_action_mosaic_triggered(); void on_action_transparent_triggered(); + void on_actionRotateLeft_triggered(); void on_actionRotateRight_triggered(); void on_actionMirrorHorizontal_triggered(); void on_actionMirrorVertical_triggered(); void on_actionFont_triggered(); + void setColorFill(); void setColorBorder(); void spinValueChange(int); diff --git a/mainwindow.ui b/mainwindow.ui index 638a1ba..1c8ad1f 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -27,7 +27,7 @@ 0 0 1050 - 24 + 23 @@ -65,6 +65,7 @@ + @@ -113,6 +114,9 @@ + + + 打开 @@ -121,6 +125,9 @@ + + + 保存 @@ -129,6 +136,9 @@ + + + 另存为 @@ -137,6 +147,9 @@ + + + 退出 @@ -145,6 +158,9 @@ + + + 撤销 @@ -153,6 +169,9 @@ + + + 重做 @@ -161,6 +180,9 @@ + + + 复制 @@ -169,6 +191,9 @@ + + + 剪切 @@ -177,6 +202,9 @@ + + + 粘贴 @@ -185,6 +213,9 @@ + + + 全选 @@ -193,6 +224,9 @@ + + + 删除 @@ -223,6 +257,9 @@ + + + 属性 @@ -231,11 +268,17 @@ + + + 设为壁纸 + + + 帮助 @@ -244,16 +287,25 @@ + + + 更新日志 + + + 关于 + + + 新建 @@ -574,6 +626,14 @@ 颜色透明 + + + 马赛克 + + + Ctrl+M + +