ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp
changeset 52 a3a4c0de738e
parent 50 a0f57508af73
child 62 36d93b4dc635
equal deleted inserted replaced
50:a0f57508af73 52:a3a4c0de738e
   879 // ---------------------------------------------------------------------------
   879 // ---------------------------------------------------------------------------
   880 //
   880 //
   881 int GlxMLWrapperPrivate::RetrieveItemSize(int aItemIndex)
   881 int GlxMLWrapperPrivate::RetrieveItemSize(int aItemIndex)
   882 {
   882 {
   883     const TGlxMedia& item = iMediaList->Item( aItemIndex );
   883     const TGlxMedia& item = iMediaList->Item( aItemIndex );
   884     int itemSize ;
   884     TUint itemSize ;
   885     item.GetSize(itemSize);
   885     item.GetSize(itemSize);
   886     return itemSize;
   886     return itemSize;
   887  }
   887  }
   888 
   888 
   889 // ---------------------------------------------------------------------------
   889 // ---------------------------------------------------------------------------
  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     if ( aBitmap->SizeInPixels().iWidth > itemWidth || aBitmap->SizeInPixels().iHeight > itemHeight ) {
  1319     pixmap = pixmap.scaled( itemWidth, itemHeight, Qt::KeepAspectRatio );
  1320         pixmap = pixmap.scaled( itemWidth, itemHeight, Qt::KeepAspectRatio );
  1320   
  1321     }
       
  1322     
  1321     
  1323     aBitmap->UnlockHeap();
  1322     aBitmap->UnlockHeap();
  1324     HbIcon* targetIcon = new HbIcon( QIcon( pixmap ) );
  1323     HbIcon* targetIcon = new HbIcon( QIcon( pixmap ) );
  1325     return targetIcon;
  1324     return targetIcon;
  1326 }
  1325 }