Hi Ed,

Yes it is possible. The following is taken from 'Java 2D Graphics' by
Jonathon Knudsen, page 326:

public static long getImageSize(BufferedImage image) {
  DataBuffer db = image.getRaster().getDataBuffer();
  int dataType = db.getDataType();
  int elementSizeInBits = DataBuffer.getDataTypeSize(dataType);
  return db.getNumBanks() * db.getSize() * elementSizeInBits / 8;
}

According to the text in the book this calculates the full size of the
image's data buffers.

Hope this helps
Regards
Damian

> -----Original Message-----
> From: Ed Brown [mailto:[EMAIL PROTECTED]]
> Sent: 23 July 2002 18:28
> To: [EMAIL PROTECTED]
> Subject: [JAVA2D] BufferedImage
>
>
> Hi All
>
> Is it possible to get a measure of how much memory a
> BufferedImage object is taking up?
>
> Thanks
> Ed Brown
>
> ==============================================================
> =============
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff JAVA2D-INTEREST".  For general help,
> send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to