uifw/ganes/src/HgVgLetterPopup.cpp
branchRCL_3
changeset 10 3d340a0166ff
parent 8 71dd06cfe933
child 18 fcdfafb36fe7
equal deleted inserted replaced
9:0aa5fbdfbc30 10:3d340a0166ff
    52 //
    52 //
    53 void CHgVgPopup::ConstructL (  )
    53 void CHgVgPopup::ConstructL (  )
    54     {
    54     {
    55     iPrevText = ((TDesC)KNullDesC).AllocL();
    55     iPrevText = ((TDesC)KNullDesC).AllocL();
    56 
    56 
    57     iDrawBuffer = CHgVgDrawBuffer::NewL(iRect.Size(), EGray2);
    57     iDrawBuffer = CHgVgDrawBuffer::NewL(iRect.Size(), EGray256);
    58 
    58 
    59     iDrawBuffer->Gc().UseFont(iFont);
    59     iDrawBuffer->Gc().UseFont(iFont);
    60     iDrawBuffer->Gc().SetPenColor(KRgbWhite);
    60     iDrawBuffer->Gc().SetPenColor(KRgbWhite);
    61     iDrawBuffer->Gc().SetBrushColor(KRgbBlack);
    61     iDrawBuffer->Gc().SetBrushColor(KRgbBlack);
    62     
    62     
    63     // Create VG Image to use
    63     // Create VG Image to use
    64     iLetterImage = vgCreateImage(VG_A_1, 
    64     iLetterImage = vgCreateImage(VG_A_8, 
    65             iRect.Width(), iRect.Height(), 
    65             iRect.Width(), iRect.Height(), 
    66             VG_IMAGE_QUALITY_NONANTIALIASED);
    66             VG_IMAGE_QUALITY_NONANTIALIASED);
    67 
    67 
    68     if( iLetterImage == VG_INVALID_HANDLE )
    68     if( iLetterImage == VG_INVALID_HANDLE )
    69         {
    69         {
   138 /*        TInt width = iFont->TextWidthInPixels(aText);
   138 /*        TInt width = iFont->TextWidthInPixels(aText);
   139         TInt height = iFont->HeightInPixels();
   139         TInt height = iFont->HeightInPixels();
   140         TPoint pos(iRect.Width() / 2 - width / 2, 
   140         TPoint pos(iRect.Width() / 2 - width / 2, 
   141                 iRect.Height() / 2 + height / 2);
   141                 iRect.Height() / 2 + height / 2);
   142         iDrawBuffer->DrawText(aText, iFont, KRgbWhite, pos);*/
   142         iDrawBuffer->DrawText(aText, iFont, KRgbWhite, pos);*/
   143         iDrawBuffer->GetDrawBufferToVgImage(iRect.Size(), TPoint(0,0), iLetterImage, VG_A_1);
   143         iDrawBuffer->GetDrawBufferToVgImage(iRect.Size(), TPoint(0,0), iLetterImage, VG_A_8);
   144         }
   144         }
   145     }
   145     }
   146 
   146 
   147 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   148 // CHgVgPopup::SetTexts()
   148 // CHgVgPopup::SetTexts()
   157     TPoint pos(iRect.Width() / 2 - w1 / 2, iRect.Height() / 2);
   157     TPoint pos(iRect.Width() / 2 - w1 / 2, iRect.Height() / 2);
   158     iDrawBuffer->Gc().DrawText(aText1, pos);
   158     iDrawBuffer->Gc().DrawText(aText1, pos);
   159     pos.iY += height;
   159     pos.iY += height;
   160     pos.iX = iRect.Width() / 2 - w2 / 2;
   160     pos.iX = iRect.Width() / 2 - w2 / 2;
   161     iDrawBuffer->Gc().DrawText(aText2, pos);
   161     iDrawBuffer->Gc().DrawText(aText2, pos);
   162     iDrawBuffer->GetDrawBufferToVgImage(iRect.Size(), TPoint(0,0), iLetterImage, VG_A_1);    
   162     iDrawBuffer->GetDrawBufferToVgImage(iRect.Size(), TPoint(0,0), iLetterImage, VG_A_8);    
   163     }
   163     }
   164 
   164 
   165 // -----------------------------------------------------------------------------
   165 // -----------------------------------------------------------------------------
   166 // CHgVgPopup::Draw()
   166 // CHgVgPopup::Draw()
   167 // -----------------------------------------------------------------------------
   167 // -----------------------------------------------------------------------------