×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    38

    how i get trancperency image

    hi symbian developers,
    i want to make a bitmap image trancperce i had tried this code

    gc.bitblt(Tpoint(0,0),iBitmap1);
    iBitmap1->TrancperecyBitmap(iBitmap1);
    but its giving an error that function miss match
    M.Narendra
    narendra.ajel@gmail.com

  2. #2
    Registered User
    Join Date
    May 2007
    Location
    Poland
    Posts
    606

    Re: how i get trancperency image

    Hello,
    you could use the following code to make bitmap transparent:
    Code:
    	AknIconUtils::CreateIconL(iBitmap, iMask, KMBMFilePath,
    			EMbmBitmap, EMbmBitmap_mask);
    	AknIconUtils::SetSize(iBitmap, TSize( 240, 124), EAspectRatioPreserved);
    	AknIconUtils::SetSize(iMask, TSize( 240, 124), EAspectRatioPreserved);
    and than in draw function:
    Code:
    	gc.BitBltMasked(TPoint, iBitmap, TRect, iMask, EFalse);
    good luck
    nuker85

  3. #3
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: how i get trancperency image


  4. #4
    Registered User
    Join Date
    Aug 2009
    Posts
    38

    Re: how i get trancperency image

    [QUOTE=nuker85;637393]Hello,
    you could use the following code to make bitmap transparent:
    Code:
    	AknIconUtils::CreateIconL(iBitmap, iMask, KMBMFilePath,
    			EMbmBitmap, EMbmBitmap_mask);
    	AknIconUtils::SetSize(iBitmap, TSize( 240, 124), EAspectRatioPreserved);
    	AknIconUtils::SetSize(iMask, TSize( 240, 124), EAspectRatioPreserved);
    and than in draw function:
    Code:
    	gc.BitBltMasked(TPoint, iBitmap, TRect, iMask, EFalse);
    i closed all the braces please help me
    M.Narendra
    narendra.ajel@gmail.com

  5. #5
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: how i get trancperency image

    1. Load image
    2. Load image mask
    3. Draw image using BitBltMasked() function

    Code:
    // .h
    //-------
       CFbsBitmap *iImg;
       CFbsBitmap *iImgMask;
          
    // .cpp
    //-------
    
    _LIT(KImgFile, "c:\\data\\images\\ImgFile.mbm"); // for testing purposes
    
    void Cxxx::LoadImagesL()
       {
       iImg = CEikonEnv::Static()->CreateBitmapL(KImgFile, EMyImageID);
       iImgMask = CEikonEnv::Static()->CreateBitmapL(KImgFile, EMyImageMaskID);
       }
       
    Cxxx::~Cxxx()
       {
       if (iImg)
          {
          delete iImg;
          iImg = NULL;
          }
    
       if (iImgMask)
          {
          delete iImgMask;
          iImgMask = NULL;
          }
       }
       
    void Cxxx::Draw()
       {
       CWindowGc& gc = SystemGc();
    
       gc.Clear();
       
       gc.BitBltMasked(TPoint(aRect.iTl.iX, aRect.iTl.iY), 
          iImg, 
          TRect(TPoint(0, 0), iImg->SizeInPixels()), 
          iImgMask, 
          ETrue);
       }

  6. #6
    Registered User
    Join Date
    Aug 2009
    Posts
    38

    Re: how i get trancperency image

    Quote Originally Posted by A.A.M. View Post
    1. Load image
    2. Load image mask
    3. Draw image using BitBltMasked() function

    Code:
    // .h
    //-------
       CFbsBitmap *iImg;
       CFbsBitmap *iImgMask;
          
    // .cpp
    //-------
    
    _LIT(KImgFile, "c:\\data\\images\\ImgFile.mbm"); // for testing purposes
    
    void Cxxx::LoadImagesL()
       {
       iImg = CEikonEnv::Static()->CreateBitmapL(KImgFile, EMyImageID);
       iImgMask = CEikonEnv::Static()->CreateBitmapL(KImgFile, EMyImageMaskID);
       }
       
    Cxxx::~Cxxx()
       {
       if (iImg)
          {
          delete iImg;
          iImg = NULL;
          }
    
       if (iImgMask)
          {
          delete iImgMask;
          iImgMask = NULL;
          }
       }
       
    void Cxxx::Draw()
       {
       CWindowGc& gc = SystemGc();
    
       gc.Clear();
       
       gc.BitBltMasked(TPoint(aRect.iTl.iX, aRect.iTl.iY), 
          iImg, 
          TRect(TPoint(0, 0), iImg->SizeInPixels()), 
          iImgMask, 
          ETrue);
       }
    THANKS YOU FOR YOUR RESPONCE NOW ITS WORKING
    M.Narendra
    narendra.ajel@gmail.com

Similar Threads

  1. --- ???save image problem??? ---
    By ferenn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2007-10-01, 14:33
  2. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  3. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  4. HELP: Mutable Image to Immutable Image?
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-26, 09:58
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×