ScaleL() func. not working for higher destination size

Login to reply to this topic.
Fri, 2006-05-05 07:20
Joined: 2005-08-24
Forum posts: 34
Hello,

I am working on scaling of images for 2 resolutions (640*480) & (1280*960). For that purpose I am using the below mentioned function of the CMdaBitmapScaler class

Code:
void ScaleL(MMdaImageUtilObserver& aObserver,CFbsBitmap& aSrcBitmap,TSize aDestSize,TBool aMaintainAspectRatio = ETrue);

This function works properly for first destinaion size that I am providing 640*480 as after the ScaleL() function the corresponding
Code:
void MiuoConvertComplete(TInt aError)
gets called & i get the desired output

However if I scale the images for the destination size (1280*960), I dont get the desired result
I have traced that when the flow enters the
Code:
void MiuoConvertComplete(TInt aError)
function it checks the aError parameter which is not KErrNone & hence doesnot proceed further

Does this function not work for higher destination size?

Please let me know



Thanks,

Yogesh Khanolkar

Fri, 2006-05-05 11:36
Joined: 2004-11-29
Forum posts: 1246
Re: ScaleL() func. not working for higher destination size
Maybe you simply got out of memory.

You should check what that error code you got mean. It should help you track down the problem.
Thats what they are for you know Smiley
Mon, 2006-05-08 07:56
Joined: 2005-08-24
Forum posts: 34
Re: ScaleL() func. not working for higher destination size
Hi Alh,

Yes u said it rite... its a memory issue... i checked the error code & it gave me an error code -4 which, means KErrNoMemory

But now how should I proceed?

What I am doing is i am scaling the bitmaps I have to the images that the phone camera produces (i.e 640*480, 1280*960, etc)

My application sucessfully works for 640*480, but not for 1280*960

Please suggest me an alternate solution if possible




Thanks,

Yogesh Khanolkar
Tue, 2006-05-09 07:57
Joined: 2005-06-09
Forum posts: 174
Re: ScaleL() func. not working for higher destination size
Assuming 32 bits per pixel:  1280 * 960 * 4 = 4915200, ie. 5MB, which is quite a lot on most  phones.  These pictures obviously aren't meant to be displayed on the device you're scaling them on, so the easiest solution would be to scale them at the other end, after you've transferred them to some more powerful device.  If that's not possible, you could use a scheme that doesn't require the whole bitmap to be in memory at once.  Either partition the bitmap to scale into smaller bitmap, scale those individually (using the same API function you're using now) and then piece them together, or just write your own scaling code.

Tue, 2006-05-09 11:03
Joined: 2005-08-24
Forum posts: 34
Re: ScaleL() func. not working for higher destination size
Hi puterman,

thanks for your reply, but then I would like to ask u a question

What about the images which the camera captures? For eg. the Nokia 6680 gives you an image of 1280*960 on your device. Hows that possible?



Regards,

Yogesh Khanolkar
Wed, 2006-05-10 11:26
Joined: 2004-11-29
Forum posts: 1246
Re: ScaleL() func. not working for higher destination size

Camera hardware can usually output the image already compressed, so the app controlling the camera don't have to handle the full uncompressed image.

This you have to do if you want to rescale it. (well, not really, but its not trivial to implement it otherwise. I know a company selling exactly that for good money..).

  • Login to reply to this topic.