views:

32

answers:

1

Hi,

i want to run the applet on the browser in java.I have to load and manipulate big size images on the applet.

whether is it possible or not? can any body give me the resolution for the same.

Thanks, Mishal Shah

+2  A: 

It mostly depends on how much memory the browser will give your VM. If it doesn't specify anything, you have 64MB with the Sun VM which limits how big the image in RAM can be.

But the actual image can be much bigger: Uncompress the image into a file and then use mmap'd file access (see FileChannel if your have Java 5). Then you can access the raw data and work on any image size (even though it will be slower than when you can keep the whole image in RAM).

If you have Java 1.4, you'll have to use RandomFileAccess and implement your own buffering strategy. That can be pretty slow, though, depending on the operations you want to support.

If that's not enough, your other options are to allow users to download the application or maybe Java WebStart.

Aaron Digulla
That's slightly confused. If you can use `FileChannel` you need to be trusted and can therefore specify greater than 64 MB.
Tom Hawtin - tackline
@Tom Hawtin: I didn't know that you can specify the memory for an applet. Do you have a link?
Aaron Digulla
@Aaron: It's part of the 6u10 stuff. IIRC, it needs to be a signed applet using JNLP. Gets its own process.
Tom Hawtin - tackline
@Tom: FileChannel is available with Java 5, JNLP needs Java 6.
Aaron Digulla