views:

128

answers:

1

Hi all,

I would like to load a cropped version of a bitmap image into a Bitmap object, without loading the original bitmap as well.

Is this at all possible without writing custom loading routines to handle the raw data?

Thanks, Sandor

+1  A: 

It's actually very straightforward to do. Use

Bitmap yourBitmap = Bitmap.createBitmap(sourceBitmap, x to start from, y to start from, width, height)

Steve H
Thanks Steve, but that would require me to load in the sourceBitmap first, and I am trying to avoid doing that, since it is too large to fit in memory, and I want to work with a bitmap that has not been downsampled.
Schermvlieger
Oops, you're right, I didn't read that part of your question properly. I'm not sure then how to do this without downsampling. In fact a very similar problem is on my own figure-out-how-to-do list as well!
Steve H