int aHeight = myViewPort->height();
Image_PixMap aPix;
- view->ToPixMap( aPix,aWidth, aHeight,Graphic3d_BT_RGBA );
+#if OCC_VERSION_LARGE >= 0x07020000
+ view->ToPixMap( aPix,aWidth, aHeight,Graphic3d_BT_RGBA );
QImage anImage( aPix.Data(), aWidth, aHeight, QImage::Format_ARGB32 );
anImage = anImage.mirrored();
anImage = anImage.rgbSwapped();
-
+#else
+ view->ToPixMap(aPix, aWidth, aHeight, Graphic3d_BT_RGB);
+ QImage anImage( aWidth, aHeight, QImage::Format_ARGB32 );
+ for ( int i = 0; i < aWidth; i++ ) {
+ for ( int j = 0; j < aHeight; j++ ) {
+ Quantity_Color pixel = aPix.PixelColor( i, j ).GetRGB();
+ QColor color = QColor::fromRgbF( pixel.Red(), pixel.Green(), pixel.Blue() );
+ anImage.setPixelColor( i, j, color );
+ }
+ }
+ if ( aPix.IsTopDown() )
+ anImage = anImage.mirrored();
+#endif
if( myBand && myBand->isVisible() )
{
QPixmap aPixmap = QPixmap::fromImage( anImage );
myBand->render( &aPixmap, p );
anImage = aPixmap.toImage();
}
-
return anImage;
}