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.....:?:

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.