messagingappbase/msgeditor/mediacontrolsrc/MsgImageControl.cpp
branchRCL_3
changeset 66 fc3320e39880
parent 0 72b543305e3a
child 77 da6ac9d688df
equal deleted inserted replaced
60:7fdbb852d323 66:fc3320e39880
   151     TSize sourceSize( iSourceImage->Size() );
   151     TSize sourceSize( iSourceImage->Size() );
   152     TSize targetSize = TSize(
   152     TSize targetSize = TSize(
   153     	Min( sourceSize.iWidth, iMaxSize.iWidth - iFrame->FrameBorderSize().iWidth ),
   153     	Min( sourceSize.iWidth, iMaxSize.iWidth - iFrame->FrameBorderSize().iWidth ),
   154 		Min( sourceSize.iHeight, iMaxSize.iHeight - iFrame->FrameBorderSize().iHeight ) );
   154 		Min( sourceSize.iHeight, iMaxSize.iHeight - iFrame->FrameBorderSize().iHeight ) );
   155 
   155 
       
   156     // In case of KImageTypePNGUid and KImageTypeBMPUid 
       
   157     // with and without IsAnimation, call CreateImageViewerL with
       
   158     // Flags zero. This to avoid image corruption  when IsAnimation is flase and 
       
   159     // Image resize happened based on control size.
       
   160 
       
   161     TUint32 flagOptions = 0;
       
   162     
   156     if ( !iSourceImage->IsAnimation() &&
   163     if ( !iSourceImage->IsAnimation() &&
   157          ( iSourceImage->ImageType() == KImageTypeBMPUid || 
   164            iSourceImage->ImageType() == KImageTypeGIFUid )
   158            iSourceImage->ImageType() == KImageTypeGIFUid ||
   165         {
   159            iSourceImage->ImageType() == KImageTypePNGUid ) )
   166         	flagOptions |= MIHLImageViewer::EOptionUseBilinearInterpolation;
   160         {
   167       	}
   161         iEngine = IHLViewerFactory::CreateImageViewerL( targetSize,
   168  	  iEngine = IHLViewerFactory::CreateImageViewerL( targetSize,
   162                                                         *iSourceImage, 
   169                                                     *iSourceImage, 
   163                                                         *iDestinationBitmap, 
   170                                                     *iDestinationBitmap, 
   164                                                         *this, 
   171                                                     *this, 
   165                                                         MIHLImageViewer::EOptionUseBilinearInterpolation);
   172                                                     flagOptions);                        	
   166         }
       
   167    else
       
   168         {
       
   169         iEngine = IHLViewerFactory::CreateImageViewerL( targetSize,
       
   170                                                         *iSourceImage, 
       
   171                                                         *iDestinationBitmap, 
       
   172                                                         *this, 
       
   173                                                         0 );
       
   174         
       
   175         }
       
   176     }
   173     }
   177 
   174 
   178 // ---------------------------------------------------------
   175 // ---------------------------------------------------------
   179 // CMsgImageControl::Cancel
   176 // CMsgImageControl::Cancel
   180 // ---------------------------------------------------------
   177 // ---------------------------------------------------------