First of all thank you very much everyone for your help.

I continue with a problem. I use Runtime.getRuntime().freeMemory() for
obtain the free memory and compare it with the real Bitmap memory.
Sometimes I get a free memory less than that occupied by the image.
However, if I remove the restriction on the size of the image, I can
work with it without any problem. Am I using an incorrect function to
get the free memory?. Should I use another function?

Thank you very much in advance.

On 23 jul, 20:40, DanH <danhi...@ieee.org> wrote:
> Close as I can tell, you use a BitmapFactory.Options and put a
> BitmapConfig constant in that that specifies the type of internal
> representation you want.  If you use ARGB_8888 then each pixel will be
> 64 bits.  ARGB_4444 -- 32 bits, RGB_565 -- 16 bits.
>
> On Jul 23, 12:21 pm, ReyLith <jesus...@gmail.com> wrote:
>
>
>
> > Thanks Nathan.
>
> > With this option I can obtain the image characteristics but I don't
> > know the option that indicates me the depth of the pixel. Width and
> > Height are in outWidth and outHeight but I don't know where is the
> > depth. I thought use the getRowBytes() of Bitmap and product it with
> > getHeight() of Bitmap, but I don't know if there is correct.
>
> > On 23 jul, 18:52, Nathan <nathan.d.mel...@gmail.com> wrote:
>
> > > If you can get the width and height for the image without completely
> > > opening it, then use the width*height*depth.
>
> > > You probably have to use this option:
>
> > >http://developer.android.com/intl/de/reference/android/graphics/Bitma...
>
> > > Nathan
>
> > > On Jul 23, 9:30 am, ReyLith <jesus...@gmail.com> wrote:
>
> > > > So, how can I obtain the depth for know if I can work with the image?
>
> > > > On 23 jul, 18:18, DanH <danhi...@ieee.org> wrote:
>
> > > > > The size of an image file depends greatly on the compression
> > > > > techniques used to create it.  Virtually all image formats involve
> > > > > some sort of compression such that the total number of bits in the
> > > > > file is considerably less than the (width * height * depth) number
> > > > > that represents the raw image.
>
> > > > > On Jul 23, 7:27 am, ReyLith <jesus...@gmail.com> wrote:
>
> > > > > > Hi again,
>
> > > > > > I'm trying to put a message when the image is so big. For this I 
> > > > > > think
> > > > > > to obtain the size of the file and compare it with the free memory
> > > > > > Runtime.getRuntime().getFreeMemory()). It works well but I have a 
> > > > > > new
> > > > > > problem. The application show an error message with some images
> > > > > > because they are so big and the application dont't detect the 
> > > > > > problem.
> > > > > > I research in other posts and the problem is that the file size is
> > > > > > different from the size of the image in memory. To get the size of 
> > > > > > the
> > > > > > image in memory I use the product getHeight () * getRowBytes () of 
> > > > > > the
> > > > > > Bitmap class, but with some images not previously had problems, I 
> > > > > > get
> > > > > > very large sizes, so often I get the message erroneously.
>
> > > > > > Does anyone know how could solve this problem?
>
> > > > > >  Thank you very much in advance.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to