⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cpp

📁 qt qimage 显示图象类的使用
💻 CPP
📖 第 1 页 / 共 2 页
字号:
    textLabel1_8 = new QLabel( this, "textLabel1_8" );    textLabel1_8->setGeometry( QRect( 290, 270, 46, 20 ) );    textLabel1_9 = new QLabel( this, "textLabel1_9" );    textLabel1_9->setGeometry( QRect( 700, 320, 30, 20 ) );    textLabel2_5 = new QLabel( this, "textLabel2_5" );    textLabel2_5->setGeometry( QRect( 710, 350, 59, 20 ) );    radioButtonGet = new QRadioButton( this, "radioButtonGet" );    radioButtonGet->setGeometry( QRect( 730, 450, 120, 20 ) );    spinBoxThreshold = new QSpinBox( this, "spinBoxThreshold" );    spinBoxThreshold->setGeometry( QRect( 830, 200, 50, 30 ) );    spinBoxThreshold->setMaxValue( 255 );    comboBoxGetAB = new QComboBox( FALSE, this, "comboBoxGetAB" );    comboBoxGetAB->setGeometry( QRect( 770, 350, 85, 27 ) );    textLabel3_4 = new QLabel( this, "textLabel3_4" );    textLabel3_4->setGeometry( QRect( 710, 380, 60, 20 ) );    textLabel4_2 = new QLabel( this, "textLabel4_2" );    textLabel4_2->setGeometry( QRect( 820, 380, 39, 20 ) );    lineEditGet = new QLineEdit( this, "lineEditGet" );    lineEditGet->setGeometry( QRect( 770, 380, 40, 21 ) );    line7 = new QFrame( this, "line7" );    line7->setGeometry( QRect( 230, 390, 20, 170 ) );    line7->setFrameShape( QFrame::VLine );    line7->setFrameShadow( QFrame::Sunken );    line7->setFrameShape( QFrame::VLine );    pushButtonRGB = new QPushButton( this, "pushButtonRGB" );    pushButtonRGB->setGeometry( QRect( 100, 490, 88, 40 ) );    pushButtonRGB->setIconSet( QIconSet( QPixmap::fromMimeSource( "AformatchangetoXPM.xpm" ) ) );    pushButtonHLS = new QPushButton( this, "pushButtonHLS" );    pushButtonHLS->setGeometry( QRect( 350, 490, 90, 40 ) );    pushButtonHLS->setIconSet( QIconSet( QPixmap::fromMimeSource( "AformatchangetoXPM.xpm" ) ) );    pushButton18 = new QPushButton( this, "pushButton18" );    pushButton18->setGeometry( QRect( 590, 110, 70, 30 ) );    pushButton18->setIconSet( QIconSet( QPixmap::fromMimeSource( "AformatchangetoXPM.xpm" ) ) );    line4 = new QFrame( this, "line4" );    line4->setGeometry( QRect( 480, 140, 210, 20 ) );    line4->setFrameShape( QFrame::HLine );    line4->setFrameShadow( QFrame::Sunken );    line4->setFrameShape( QFrame::HLine );    pushButton6 = new QPushButton( this, "pushButton6" );    pushButton6->setGeometry( QRect( 500, 190, 80, 31 ) );    pushButton3x3 = new QPushButton( this, "pushButton3x3" );    pushButton3x3->setGeometry( QRect( 780, 60, 90, 30 ) );    pushButton3x3->setIconSet( QIconSet( QPixmap::fromMimeSource( "AformatchangetoXPM.xpm" ) ) );    pushButtonThreshold = new QPushButton( this, "pushButtonThreshold" );    pushButtonThreshold->setGeometry( QRect( 750, 240, 100, 30 ) );    pushButtonThreshold->setIconSet( QIconSet( QPixmap::fromMimeSource( "AformatchangetoXPM.xpm" ) ) );    pushButtonGet = new QPushButton( this, "pushButtonGet" );    pushButtonGet->setGeometry( QRect( 770, 410, 90, 30 ) );    pushButtonGet->setIconSet( QIconSet( QPixmap::fromMimeSource( "AformatchangetoXPM.xpm" ) ) );    buttomquit = new QPushButton( this, "buttomquit" );    buttomquit->setGeometry( QRect( 790, 570, 80, 40 ) );    buttomquit->setIconSet( QIconSet( QPixmap::fromMimeSource( "BformatchangetoXPM.xpm" ) ) );    pushButtonform = new QPushButton( this, "pushButtonform" );    pushButtonform->setGeometry( QRect( 440, 20, 30, 30 ) );    textLabel1_7 = new QLabel( this, "textLabel1_7" );    textLabel1_7->setGeometry( QRect( 10, 580, 137, 20 ) );    lineEditSave = new QLineEdit( this, "lineEditSave" );    lineEditSave->setGeometry( QRect( 150, 581, 270, 30 ) );    pushButtonSave = new QPushButton( this, "pushButtonSave" );    pushButtonSave->setGeometry( QRect( 420, 580, 50, 30 ) );    line3_2 = new QFrame( this, "line3_2" );    line3_2->setGeometry( QRect( 470, 0, 20, 560 ) );    line3_2->setFrameShape( QFrame::VLine );    line3_2->setFrameShadow( QFrame::Sunken );    line3_2->setFrameShape( QFrame::VLine );    line4_2_2 = new QFrame( this, "line4_2_2" );    line4_2_2->setGeometry( QRect( 480, 250, 210, 20 ) );    line4_2_2->setFrameShape( QFrame::HLine );    line4_2_2->setFrameShadow( QFrame::Sunken );    line4_2_2->setFrameShape( QFrame::HLine );    line10 = new QFrame( this, "line10" );    line10->setGeometry( QRect( 690, 300, 180, 20 ) );    line10->setFrameShape( QFrame::HLine );    line10->setFrameShadow( QFrame::Sunken );    line10->setFrameShape( QFrame::HLine );    line8 = new QFrame( this, "line8" );    line8->setGeometry( QRect( 680, 0, 20, 560 ) );    line8->setFrameShape( QFrame::VLine );    line8->setFrameShadow( QFrame::Sunken );    line8->setFrameShape( QFrame::VLine );    line9 = new QFrame( this, "line9" );    line9->setGeometry( QRect( 0, 550, 910, 20 ) );    line9->setFrameShape( QFrame::HLine );    line9->setFrameShadow( QFrame::Sunken );    line9->setFrameShape( QFrame::HLine );    languageChange();    resize( QSize(477, 387).expandedTo(minimumSizeHint()) );    clearWState( WState_Polished );    // signals and slots connections    connect( buttomquit, SIGNAL( clicked() ), this, SLOT( close() ) );    connect( pushButton2, SIGNAL( clicked() ), this, SLOT( compare() ) );    connect( pushButton3, SIGNAL( clicked() ), this, SLOT( different() ) );    connect( imageA, SIGNAL( clicked() ), this, SLOT( openA() ) );    connect( imageB, SIGNAL( clicked() ), this, SLOT( openB() ) );    connect( pushButton6, SIGNAL( clicked() ), this, SLOT( calcolorA() ) );    connect( pushButton7, SIGNAL( clicked() ), this, SLOT( calcolorB() ) );    connect( pushButton18, SIGNAL( clicked() ), this, SLOT( formatchange() ) );    connect( pushButtonRGB, SIGNAL( clicked() ), this, SLOT( RGB() ) );    connect( pushButtonHLS, SIGNAL( clicked() ), this, SLOT( HLS() ) );    connect( slider1, SIGNAL( valueChanged(int) ), spinBox1, SLOT( setValue(int) ) );    connect( spinBox1, SIGNAL( valueChanged(int) ), slider1, SLOT( setValue(int) ) );    connect( pushButton3x3, SIGNAL( clicked() ), this, SLOT( filter3x3() ) );    connect( pushButtonform, SIGNAL( clicked() ), this, SLOT( changeformsize() ) );    connect( pushButtonThreshold, SIGNAL( clicked() ), this, SLOT( Threshold() ) );    connect( sliderThreshold, SIGNAL( valueChanged(int) ), spinBoxThreshold, SLOT( setValue(int) ) );    connect( spinBoxThreshold, SIGNAL( valueChanged(int) ), sliderThreshold, SLOT( setValue(int) ) );    connect( pushButtonSave, SIGNAL( clicked() ), this, SLOT( openSave() ) );    connect( pushButtonGet, SIGNAL( clicked() ), this, SLOT( GetN() ) );    // tab order    setTabOrder( lineEditA, imageA );    setTabOrder( imageA, lineEditB );    setTabOrder( lineEditB, imageB );    setTabOrder( imageB, pushButton2 );    setTabOrder( pushButton2, pushButton3 );    setTabOrder( pushButton3, buttomquit );    setTabOrder( buttomquit, lineEdit1 );    init();}/* *  Destroys the object and frees any allocated resources */Form1::~Form1(){    // no need to delete child widgets, Qt does it all for us}/* *  Sets the strings of the subwidgets using the current *  language. */void Form1::languageChange(){    setCaption( trUtf8( "图像处理" ) );    textLabel2->setText( trUtf8( "图像B" ) );    textLabel1_2->setText( trUtf8( "选择图像A" ) );    textLabel2_2->setText( trUtf8( "选择图像B" ) );    imageB->setText( trUtf8( "浏览" ) );    imageA->setText( trUtf8( "浏览" ) );    textLabel2_3->setText( trUtf8( "<u><b>转换图像格式</b></u>" ) );    textLabel1_3->setText( trUtf8( "<u><b>计算颜色平均值图像</b></u>" ) );    pushButton7->setText( trUtf8( "计算图像B" ) );    textLabel14->setText( trUtf8( "图像A" ) );    textLabel15->setText( trUtf8( "图像B" ) );    textLabel6->setText( trUtf8( "<u>图像处理显示</u>" ) );    textLabel1_5->setText( trUtf8( "<u>3X3滤波</u>" ) );    textLabel2_4->setText( trUtf8( "选择图像" ) );    textLabel3_2->setText( trUtf8( "选择图像" ) );    textLabel4->setText( trUtf8( "转换格式" ) );    radioButtonCal->setText( trUtf8( "保存计算后图像" ) );    radioButton3x3->setText( trUtf8( "保存滤波后图像" ) );    textLabel3_3->setText( trUtf8( "<u>二值化</u>" ) );    textLabel2_4_2->setText( trUtf8( "选择图像" ) );    textLabel1_6->setText( trUtf8( "门限" ) );    radioButtonThreshold->setText( trUtf8( "保存二值化后图像" ) );    radioButtonHLS->setText( trUtf8( "保存分割后图像" ) );    radioButtonRGB->setText( trUtf8( "保存分割后图像" ) );    textLabel10->setText( trUtf8( "分割分量" ) );    textLabel9->setText( trUtf8( "选择图像" ) );    textLabel12->setText( trUtf8( "选择图像" ) );    textLabel13->setText( trUtf8( "分割分量" ) );    textLabel11->setText( trUtf8( "<u><b>HLS分割</b></u>" ) );    textLabel8->setText( trUtf8( "<u><b>RGB分割</b></u>" ) );    textLabel1->setText( trUtf8( "图像A" ) );    textLabel3->setText( trUtf8( "信息提示" ) );    textLabel1_4->setText( trUtf8( "<u><b>图像比较</b></u>" ) );    textLabel18->setText( trUtf8( "容差" ) );    pushButton2->setText( trUtf8( "对比" ) );    pushButton3->setText( trUtf8( "计算差异点" ) );    radioButtonCom->setText( trUtf8( "保存差异图像" ) );    textLabel1_8->setText( trUtf8( "差异图" ) );    textLabel1_9->setText( trUtf8( "<u>抽点</u>" ) );    textLabel2_5->setText( trUtf8( "选择图像" ) );    radioButtonGet->setText( trUtf8( "保存抽点后图像" ) );    textLabel3_4->setText( trUtf8( "缩小比例" ) );    textLabel4_2->setText( tr( "(0-1)" ) );    pushButtonRGB->setText( trUtf8( "进行分割" ) );    pushButtonHLS->setText( trUtf8( "进行分割" ) );    pushButton18->setText( trUtf8( "转换" ) );    pushButton6->setText( trUtf8( "计算图像A" ) );    pushButton3x3->setText( trUtf8( "进行滤波" ) );    pushButtonThreshold->setText( trUtf8( "进行二值化" ) );    pushButtonGet->setText( trUtf8( "进行抽点" ) );    buttomquit->setText( trUtf8( "退出" ) );    pushButtonform->setText( tr( ">>" ) );    textLabel1_7->setText( trUtf8( "将处理后的图像保存在" ) );    pushButtonSave->setText( trUtf8( "浏览" ) );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -