×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    6

    Issue while scaling bitmaps

    Hi guys,

    Im trying to scale a bitmap using this code at this http://www.developer.nokia.com/Commu...caling_bitmaps as reference.

    this is the code i have used

    iBitmapScaler = CMyBitmapScaler::NewL(this);

    CFbsBitmap* iBitmap;
    iBitmapScaler->iBitmap = new(ELeave) CFbsBitmap;

    TInt err;
    // when i comment the next line the code works fine
    err = iBitmapScaler->iBitmap->Load(KMBMFile, iBackgroundImageNo);

    the code compiles but i cannot open the application when i load it on the phone

    Please help

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Issue while scaling bitmaps

    What is the problem you are facing exactly?
    Is it scaling the image (as per thread's subject) or you are unable to open your application?

    BTW, on commenting
    Code:
    err = iBitmapScaler->iBitmap->Load(KMBMFile, iBackgroundImageNo);
    the code may compile successfully but the image will not be created. Hence you should not comment that. You can check the SDK Help for CFBsBitmap::Load().

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    6

    Re: Issue while scaling bitmaps

    the issue is my application does not open when i use
    err = iBitmapScaler->iBitmap->Load(KMBMFile, iBackgroundImageNo);

    And when i comment this line i use another line of code (sorry for not mentioning this earlier)

    err = iBitmap->Load(KMBMFile, iBackgroundImageNo);

    i use a local bitmap as follows


    CFbsBitmap* iBitmap;
    iBitmap = new(ELeave) CFbsBitmap;

    TInt err;
    err = iBitmap->Load(KMBMFile, iBackgroundImageNo);

    This works fine and my application runs properly. However when i try to load the bitmap which is in the
    iBitmapScaler object the app crashes. i have kept iBitmap in BitmapScaler as public

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Issue while scaling bitmaps

    checking the panic code might help: http://www.developer.nokia.com/Commu...ded_panic_code

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    6

    Re: Issue while scaling bitmaps

    Thanks

    Actually i was tryin to fit a 640x320 image in a 320x240 screen, i got that done by using
    this code

    // Gets the control's extent
    TRect drawRect(Rect());

    // Clears the screen
    gc.Clear(drawRect);

    CFbsBitmap* iBitmap;
    iBitmap = new(ELeave) CFbsBitmap;

    // Background
    TInt err;
    err = iBitmap->Load(KMBMFile,iBackgroundImageNo);


    gc.DrawBitmap(drawRect, iBitmap);

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: Issue while scaling bitmaps

    One recommended way to get the screen size by app and use that to resize your bitmap

Similar Threads

  1. TimeOut Issue while using HTTPConnection
    By bhakki in forum Mobile Java General
    Replies: 2
    Last Post: 2010-10-20, 13:08
  2. issue while using sensor APIs
    By sumit.ece in forum Symbian
    Replies: 3
    Last Post: 2010-07-14, 09:33
  3. Issue while using GSoap
    By arunmdevan in forum Symbian
    Replies: 2
    Last Post: 2009-09-30, 20:30
  4. Image Scaling/Sizing issue on the N70
    By sameet in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-07-24, 12:03
  5. Scaling Bitmaps
    By ManishPatil in forum Symbian
    Replies: 1
    Last Post: 2004-07-15, 09:35

Posting Permissions

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