]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Use QImage instead of QPixmap for drawing of result image because of this method...
authoradv <adv@opencascade.com>
Fri, 13 Sep 2013 10:29:05 +0000 (10:29 +0000)
committeradv <adv@opencascade.com>
Fri, 13 Sep 2013 10:29:05 +0000 (10:29 +0000)
src/ImageComposer/ImageComposer_Operator.cxx

index cb9a75eb0131bb2571188f6acfc3732382c4b78f..2e2aabf3d902f9c6f5a1171c95a537de87f949cb 100644 (file)
@@ -72,14 +72,17 @@ ImageComposer_Image ImageComposer_Operator::process( const QVariant& theObj1,
   anImage1.setTransform( anImage1.transform() * aTranslate );
   anImage2.setTransform( anImage2.transform() * aTranslate );
 
-  QPixmap aResultImage( int(aBounds.width()), int(aBounds.height()) );
-  aResultImage.fill( myBackground );
+  QImage aResultImage( int(aBounds.width()), int(aBounds.height()), QImage::Format_ARGB32 );
+  //QPixmap aResultImage( int(aBounds.width()), int(aBounds.height()) );
+  //aResultImage.fill( myBackground );
 
   QPainter aPainter( &aResultImage );
-  aPainter.setRenderHint( QPainter::SmoothPixmapTransform, true );
+  //aPainter.setRenderHint( QPainter::SmoothPixmapTransform, true );
   aPainter.setRenderHint( QPainter::Antialiasing, true );
   aPainter.setRenderHint( QPainter::HighQualityAntialiasing, true );
 
+  aPainter.fillRect( QRect( 0, 0, int(aBounds.width()), int(aBounds.height()) ), myBackground );
+
   anImage1Var.setValue<ImageComposer_Image>( anImage1 );
   anImage2Var.setValue<ImageComposer_Image>( anImage2 );
 
@@ -90,7 +93,7 @@ ImageComposer_Image ImageComposer_Operator::process( const QVariant& theObj1,
   QTransform aResultTransform = anImage1.transform();
   aResultTransform.translate( aBounds.left(), aBounds.top() );
 
-  aResult = aResultImage.toImage();
+  aResult = aResultImage;
   aResult.setTransform( aResultTransform );
 
   return aResult;