ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp
changeset 67 199e6e1e0b54
parent 55 fb37077c270f
child 70 a91aa46552be
equal deleted inserted replaced
61:743eb0b9959e 67:199e6e1e0b54
  1313     uchar *data = (uchar *)(tempData);  
  1313     uchar *data = (uchar *)(tempData);  
  1314     int bytesPerLine = aBitmap->ScanLineLength(aBitmap->SizeInPixels().iWidth , aBitmap->DisplayMode());
  1314     int bytesPerLine = aBitmap->ScanLineLength(aBitmap->SizeInPixels().iWidth , aBitmap->DisplayMode());
  1315     //QImage share the memory occupied by data
  1315     //QImage share the memory occupied by data
  1316     QImage image(data, aBitmap->SizeInPixels().iWidth, aBitmap->SizeInPixels().iHeight, bytesPerLine, QImage::Format_RGB16);
  1316     QImage image(data, aBitmap->SizeInPixels().iWidth, aBitmap->SizeInPixels().iHeight, bytesPerLine, QImage::Format_RGB16);
  1317         
  1317         
  1318     QPixmap pixmap = QPixmap::fromImage(image);
  1318     QPixmap pixmap = QPixmap::fromImage(image);    
  1319     pixmap = pixmap.scaled( itemWidth, itemHeight, Qt::KeepAspectRatio );
  1319     if ( aBitmap->SizeInPixels().iWidth > itemWidth || aBitmap->SizeInPixels().iHeight > itemHeight ) {
  1320   
  1320         pixmap = pixmap.scaled( itemWidth, itemHeight, Qt::KeepAspectRatio );
       
  1321     }  
  1321     
  1322     
  1322     aBitmap->UnlockHeap();
  1323     aBitmap->UnlockHeap();
  1323     HbIcon* targetIcon = new HbIcon( QIcon( pixmap ) );
  1324     HbIcon* targetIcon = new HbIcon( QIcon( pixmap ) );
  1324     return targetIcon;
  1325     return targetIcon;
  1325 }
  1326 }