×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    338

    Problem Scaling a bitmap keeping Aspect Ratio

    hi,
    So far I have found two ways to resize or scale a bitmap. One is asynchronous (CBitmapScaler::Scale()) and another is (FbsBitmap::Resize()). Both works fine if it does't keep Aspect Ratio. Keeping Aspect ration gives different output which is not expected. But I need a way to do it. Kindly help me.

  2. #2
    Registered User
    Join Date
    Feb 2011
    Posts
    338

    Re: Problem Scaling a bitmap keeping Aspect Ratio

    I am getting KErrNoMemory in CBitmapScaler::Scale(). I tried to convert bitmap (794 * 1123) to (1768 * 2376). May be it is huge.. but could you suggest any other alternatives ?

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

    Re: Problem Scaling a bitmap keeping Aspect Ratio

    You need to define bigger Max Heap for your application, you are basically running out of the ma heap for the application. Or if you did increase that already, then you could also be running out of real RAM. anyway, once again, you could try my Y-Tasks, it has something called Trace which would allow you to monitor the device RAM usage, to see how it is sued.

    anyway, as we don't have screen with that size, what would be the point of having such a huge image.

  4. #4
    Registered User
    Join Date
    Feb 2011
    Posts
    338

    Re: Problem Scaling a bitmap keeping Aspect Ratio

    Actually I am not trying to show the image on screen. I have increased the heap size to 5MB MAX as you suggested. But still same error. I am currently running the program in emulator. While i tried to increase the heap size more to remove that error, but increasing more than that somehow don't let the program to run. Any way I have to test it on device and I have already Y Task. I have to test with "Trace".

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

    Re: Problem Scaling a bitmap keeping Aspect Ratio

    basically you do need to remember that your color depth also increases the image memory usage, i.e. you actually need ((1768 * 2376) * 4) = 16803072, i.e 17 Mb at least, 20 would be better to be sure other parts also can be included there.

  6. #6
    Registered User
    Join Date
    Feb 2011
    Posts
    338

    Re: Problem Scaling a bitmap keeping Aspect Ratio

    Quote Originally Posted by symbianyucca View Post
    basically you do need to remember that your color depth also increases the image memory usage, i.e. you actually need ((1768 * 2376) * 4) = 16803072, i.e 17 Mb at least, 20 would be better to be sure other parts also can be included there.
    Oh right. I forgot about the image depth. I am at first decoding an image file and loading in memory. At this time can i decrease the depth of the image? Actually I need only Black and White image from the beginning at the loading time.

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

    Re: Problem Scaling a bitmap keeping Aspect Ratio

    I can not remember strait away which way these APIs are working, anyway, you could always try as well as read the API docs.

Similar Threads

  1. Change camera viewfinder aspect ratio
    By pixsta in forum [Archived] Qt Mobility Project
    Replies: 0
    Last Post: 2011-07-03, 15:51
  2. Scaling a Bitmap
    By siva_321 in forum Symbian
    Replies: 8
    Last Post: 2009-09-30, 08:39
  3. Bitmap scaling
    By sakhya in forum Symbian
    Replies: 3
    Last Post: 2004-11-05, 04:02
  4. Nokia 3650 Video Clip - Aspect Ratio
    By lelkind in forum Symbian User Interface
    Replies: 2
    Last Post: 2003-03-10, 19:22
  5. Display's aspect ratio
    By sv2dgi in forum Mobile Java General
    Replies: 3
    Last Post: 2002-06-18, 06:45

Posting Permissions

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