equal
deleted
inserted
replaced
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 } |