i coding these line ...

it is working fine....

but what i need is compress that Bufferedimage before getting it as Raster

i tried jpeg compreesion but it return bytestream instead of int..

so i got exception "can't cast BufferdByte as BufferedInt"...

Bufferedimage image=robot.createScreenCapture(new Rectangle(width, height));
////here i need compression for above bufferdimage/////////////////
Raster ras = ((BufferedImage) image).getData();

any help.....:?:

Edited 6 Years Ago by musthafa.aj: n/a

What is wrong with this thread?

What is this int[] that you want? If it is the RGB values for the entire image, then simply use the getRGB method I posted in your other thread and don't worry about creating a "Raster" object at all. If it the RGB values for a single pixel row of the image, you can still use that method I posted in your other thread, you just need to slightly change the arguments.

Edit: And I am locking this thread now, continue in your other thread.

Edited 6 Years Ago by masijade: n/a

This article has been dead for over six months. Start a new discussion instead.