Ignore:
Timestamp:
Dec 5, 2007, 2:41:42 PM (17 years ago)
Author:
garnier
Message:

amelioration du ticket #66

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r636 r637  
    13101310  if ((!aImage.isGrayscale ()) &&(aInColor ==1 )) {
    13111311#if QT_VERSION < 0x040000
    1312     aImage.convertDepth(1,Qt::MonoOnly);
    1313 #else
    1314     aImage.convertToFormat ( aImage.format(), Qt::MonoOnly);
     1312    aImage = aImage.convertDepth(1,Qt::MonoOnly);
     1313#else
     1314    aImage = aImage.convertToFormat ( aImage.format(), Qt::MonoOnly);
    13151315#endif
    13161316  }
     
    13971397    */
    13981398  } else if (depth == 8) {
    1399 #ifdef GEANT4_QT_DEBUG
    1400     printf("has 8 bit\n");
    1401 #endif
    14021399    for(int y=height-1; y >=0 ; y--) {
    14031400      const uchar * s = aImage.scanLine(y);
     
    14941491  QPrinter printer;
    14951492  //  printer.setPageSize(pageSize);
    1496   if (aInColor == 1) {
    1497     printer.setColorMode(QPrinter::GrayScale);
    1498   } else {
    1499     printer.setColorMode(QPrinter::Color);
    1500   }
     1493
     1494  // FIXME : L. Garnier 4/12/07
     1495  // This is not working, it does nothing. Image is staying in color mode
     1496  // So I have desactivate the B/W button in GUI
     1497  if ((!aImage.isGrayscale ()) &&(aInColor ==1 )) {
     1498#if QT_VERSION < 0x040000
     1499    aImage = aImage.convertDepth(1,Qt::MonoOnly);
     1500#else
     1501    aImage = aImage.convertToFormat ( aImage.format(), Qt::MonoOnly);
     1502#endif
     1503  }
     1504
    15011505
    15021506  if (aFilename.endsWith(".ps")) {
     
    15141518  //  printer.setFullPage ( true);
    15151519  QPainter paint(&printer);
    1516   paint.drawImage (0,0,aImage );
     1520  paint.drawImage (0,0,aImage);
    15171521  paint.end();
    15181522#endif
Note: See TracChangeset for help on using the changeset viewer.