ImageQtMainForm.ui.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 void ImageQtMainForm::setImageFile()
00015 {
00016 QString file = QFileDialog::getOpenFileName( QString::null,
00017 "Images (*.pgm *.ppm)",
00018 this, "OpenImageDialog",
00019 "Choose Image" );
00020 if( !file.isEmpty() )
00021 ImageFileLineEdit->setText( file );
00022 loadImage();
00023 }
00024
00025
00026 void ImageQtMainForm::displayImage()
00027 {
00028 QPixmap qpixm = convertToQPixmap( img );
00029 if( FullSizeBox->isChecked() )
00030 {
00031 QDialog imgDialog( this, "ImageDisplay", 1 );
00032 imgDialog.setCaption( "Full-size Display" );
00033 imgDialog.setPaletteBackgroundPixmap( qpixm );
00034 imgDialog.setFixedSize( img.getWidth(), img.getHeight() );
00035 imgDialog.exec();
00036 }
00037 else
00038 {
00039 ImagePixmapLabel->setPixmap( qpixm );
00040 }
00041 }
00042
00043
00044 void ImageQtMainForm::loadImage()
00045 {
00046 QString file = ImageFileLineEdit->text();
00047 if( !file.isEmpty() )
00048 img = Raster::ReadRGB( file );
00049 else
00050 QMessageBox::critical( this, "Error",
00051 "Error: No image file specified!",
00052 QMessageBox::Ok, QMessageBox::NoButton,
00053 QMessageBox::NoButton );
00054 }