mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Add grayscale export image option. Fixed #288
This commit is contained in:
parent
8331d5f7e7
commit
1c97baa660
@ -72,7 +72,7 @@ ExportDialog::ExportDialog(int w, int h, int wsel, int hsel, QString filename_,
|
||||
|
||||
cbxImgType = new QComboBox(this);
|
||||
QStringList lst;
|
||||
lst<<tr("Colour")<<tr("Monochrome");
|
||||
lst<<tr("Colour")<<tr("Grayscale")<<tr("Monochrome");
|
||||
cbxImgType->addItems(lst);
|
||||
|
||||
cbRatio = new QCheckBox(tr("Original width to height ratio"));
|
||||
@ -365,6 +365,9 @@ ExportDialog::ImgFormat ExportDialog::getImgFormat()
|
||||
ImgFormat = ExportDialog::Coloured;
|
||||
break;
|
||||
case 1 :
|
||||
ImgFormat = ExportDialog::Grayscale;
|
||||
break;
|
||||
case 2 :
|
||||
ImgFormat = ExportDialog::Monochrome;
|
||||
break;
|
||||
default : break;
|
||||
|
@ -72,7 +72,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
enum ImgFormat {Coloured, Monochrome};
|
||||
enum ImgFormat {Coloured, Monochrome, Grayscale};
|
||||
|
||||
QString FileToSave();
|
||||
bool isOriginalSize();
|
||||
|
@ -199,6 +199,9 @@ int ImageWriter::print(QWidget *doc)
|
||||
case ExportDialog::Coloured :
|
||||
img = new QImage(w,h,QImage::Format_RGB888);
|
||||
break;
|
||||
case ExportDialog::Grayscale :
|
||||
img = new QImage(w,h,QImage::Format_Grayscale8);
|
||||
break;
|
||||
case ExportDialog::Monochrome :
|
||||
img = new QImage(w,h,QImage::Format_Mono);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user