chunk of a big big image

All your problems with Audio, Video and Images.

chunk of a big big image

Postby orux » Wed May 13, 2009 3:26 pm

Hello all;

I am working with big images, bigger than 5000x5000 pixels.
It is not possible to create a bitmap with all the image, without scaling it. I have obvious memory problems.

Anyone knows how I can load a chunk, without lost of resolution?

My last option is store the images splitting them in reasonable size chunks, but I would rather have the images in the sd without previous changes.

Any idea'

Thanks!
orux
Freshman
Freshman
 
Posts: 5
Joined: Wed May 13, 2009 3:12 pm

Top

Postby padde » Wed May 13, 2009 4:42 pm

Unfortunately BitmapFactory has no function like
Bitmap createBitmap(Bitmap source, int x, int y, int width, int height)
to get just a part of the image.
I guess your best chance is to write the function yourself with
BitmapFactory.decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts).
You will need information about the image format.. the most easy one would be bmp but results
in huge filesize..all in all not an easy task.
Is their no chance of pre splitting the image?
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby orux » Wed May 13, 2009 5:57 pm

padde wrote:Is their no chance of pre splitting the image?


Thanks padde;

I think that pre-splitting should be the final solution, because write my own decoder could be a hard work, specially with compressed formats. Possibly easy with bmp files, but those files are too large to be stored and managed.

I don't understand how android can manage a 3MP photo, and show it with a 1:1 zoom (can android do that?). I can't create a Bitmap bigger than 1200x1200 aprox.
orux
Freshman
Freshman
 
Posts: 5
Joined: Wed May 13, 2009 3:12 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests