phoneuis/BubbleManager/bmcustomization/src/telbubblecallimage.cpp
branchRCL_3
changeset 44 3c221667e687
parent 0 5f000ab63145
child 57 94dc1107e8b2
equal deleted inserted replaced
39:b8d67d6176f5 44:3c221667e687
    19 #include <telbubblecallimage.h>
    19 #include <telbubblecallimage.h>
    20 #include <gdi.h>
    20 #include <gdi.h>
    21 
    21 
    22 // ======== LOCAL FUNCTIONS ========
    22 // ======== LOCAL FUNCTIONS ========
    23 
    23 
       
    24 /**
       
    25  * Draws rounded rect. Used for drawing frame to caller image bitmap.
       
    26  */
       
    27 void DrawRoundRect(CWindowGc& aGC, TPoint aTopLeft, TSize aSize )
       
    28     {   
       
    29     const TRgb white( 255, 255, 255);
       
    30     aGC.SetPenColor( white );
       
    31     aGC.SetPenSize( TSize( 5, 5 ) );
       
    32     
       
    33     TPoint bottomRight = aTopLeft + aSize;
       
    34     TRect decoratorRect( aTopLeft, bottomRight );
       
    35     // Make rect litle larger so that it will be outside of the caller image, 
       
    36     // so that bitmap's corners are hidden.
       
    37     decoratorRect.Grow( 2, 2 ); 
       
    38     const TSize ellipsesSize( 10, 10 );
       
    39     aGC.DrawRoundRect( decoratorRect, ellipsesSize );
       
    40     }
       
    41 
    24 // ---------------------------------------------------------------------------
    42 // ---------------------------------------------------------------------------
    25 // Constructor
    43 // Constructor
    26 // ---------------------------------------------------------------------------
    44 // ---------------------------------------------------------------------------
    27 //
    45 //
    28 EXPORT_C CTelBubbleCallImage::CTelBubbleCallImage()
    46 EXPORT_C CTelBubbleCallImage::CTelBubbleCallImage()
   217 // CTelBubbleCallImage::Draw
   235 // CTelBubbleCallImage::Draw
   218 // ---------------------------------------------------------------------------
   236 // ---------------------------------------------------------------------------
   219 //
   237 //
   220 EXPORT_C void CTelBubbleCallImage::Draw( const TRect& /*aRect*/ ) const
   238 EXPORT_C void CTelBubbleCallImage::Draw( const TRect& /*aRect*/ ) const
   221     {
   239     {
   222     CWindowGc& gc = SystemGc();
   240     if ( iImage ) 
   223     
   241         {
   224     TPoint topLeft = IsFullScreenImage() ? Rect().iTl : iImagePlacingArea.iTl;
   242         CWindowGc& gc = SystemGc();
   225     
   243         const TPoint topLeft = IsFullScreenImage() ? Rect().iTl : iImagePlacingArea.iTl;
   226     
   244         const TPoint bitmapTopLeft = topLeft + iOffset;
   227     if ( iImage && iMask )
   245        
   228         {
   246         if( iMask ) 
   229         gc.BitBltMasked( topLeft + iOffset,
   247             {
   230                          iImage, 
   248             gc.BitBltMasked( bitmapTopLeft,
   231                          iSourceRect, 
   249                              iImage, 
   232                          iMask, 
   250                              iSourceRect, 
   233                          EFalse );
   251                              iMask, 
   234         }
   252                              EFalse );
   235     else if ( iImage )
   253             }
   236         {
   254         else            
   237         gc.BitBlt( topLeft + iOffset, 
   255             {
   238                    iImage,
   256             gc.BitBlt( bitmapTopLeft,
   239                    iSourceRect );    
   257                        iImage,
       
   258                        iSourceRect );    
       
   259             }
       
   260         DrawRoundRect( gc, bitmapTopLeft, iSourceRect.Size() );
   240         }
   261         }
   241     }
   262     }
   242 
   263 
   243 // end of file
   264 // end of file