Thank you!
I still can't find answer to my other question - how the rectangles (or shapes,
in general) are drawn.
Here is an example from Building Imaging Application with Java Technology by
L.H. Rodriques on page 159:
-- Listing 5.1 --
protected BufferedImage offScrImage;
protected Graphics2D offScrGc;
public void createOffScreenImage(int wid, int ht){
offScrImage = new BufferedImage(wid, ht,BufferedImage.TYPE_INT_RGB);
offScrGc = offScrImage.createGraphics();
}
public void drawRectOffScreen(){
offScrGc.drawRect(30,40,100,100,this);
}
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.drawImage(offScrImage, 0,0, this);
}
-
In the above example, the recangle is drawn off-screen to a buffered image (I
guess
this happens indicetly by calling the graphic context).
A proper (?) way to draw a rectangle into a buffered image would be through a
DataBuffer, a SampleModel and a WritableRaster.
Are these two methods identical? If not, what is the drawback of using the
above listing versus a BufferedImage pupulated with a
DataBuffer/SampleModel/WritableRaster?
Thanks again.
Gregory
[Message sent by forum member 'gmiecznik' (gmiecznik)]
http://forums.java.net/jive/thread.jspa?messageID=248451
===
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.