Posted By:
Rahi_Parsi
Posted On:
Thursday, June 13, 2002 10:31 AM
Hi I need some help regarding AWT Image processing. Specifically, I have a "buffer" defined by the following: public class Buffer extends Object { public int pixels[]=null; public Dimension size=null; public Buffer(int w,int h) { super(); pixels=new int[w*h]; size=new Dimension(w,h); } } Now, I would like to know how to do the following in the most efficient way possible: (i) How to fill in a portion of the Buffer with a colour public void fillRect(Rectangle rect,int c) { ...} (ii) How to create an Image from a portion of Buffer public Image createImage(Rectangle rect) { ...}
More>>
Hi I need some help regarding AWT Image processing. Specifically, I have a "buffer" defined by the following:
public class Buffer extends Object
{ public int pixels[]=null;
public Dimension size=null;
public Buffer(int w,int h)
{ super(); pixels=new int[w*h];
size=new Dimension(w,h);
}
}
Now, I would like to know how to do the following in the most efficient way possible:
(i) How to fill in a portion of the Buffer with a colour
public void fillRect(Rectangle rect,int c)
{ ...}
(ii) How to create an Image from a portion of Buffer
public Image createImage(Rectangle rect)
{ ...}
Any help would be greatly appreciated!
<<Less