Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3270 > unrolled thread

Graphics2D question.

Started by"RichT" <richt@THRWHITE.remove-dii-this>
First post2011-04-27 15:43 +0000
Last post2011-04-27 15:44 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.gui


Contents

  Graphics2D question. "RichT" <richt@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
    Re: Graphics2D question. "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000

#3270 — Graphics2D question.

From"RichT" <richt@THRWHITE.remove-dii-this>
Date2011-04-27 15:43 +0000
SubjectGraphics2D question.
Message-ID<h9ednRcf6MSkH0TanZ2dneKdnZydnZ2d@bt.com>
  To: comp.lang.java.gui
Hello,

I want to build my application from three main classes.
1. A frame class to handle file operations.
2. A Drawing panel to render images to.
3. An engine to perform the actual rendering.

All the examples I have read so far for Image stuff in Java have 
everything stuffed into one monolithic class, and the crux of the 
rendering seems to be done in paint(Graphics g) or 
paintComponent(Graphics g) using a g2d object cast againg the parameter g.

If I wanted to do calculations for rotations translations etc I can do 
this with the AffineTransform class setX methods, but the drawImage 
method of g2d seems to be handled in the paint/paintComponent methods.

This is fine until I want to specify x, y arguments in the drawImage 
Method as neither Paint or PaintComponent take these parameters in their 
method signature how can I do this, is there another way to draw apart 
from the paint/paint component methods?

Any help appreciated.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#3294

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:44 +0000
Message-ID<1pt1u3hclo3dd8084v3fv3m41s1sb5i90o@4ax.com>
In reply to#3270
  To: comp.lang.java.gui
On Thu, 13 Mar 2008 19:34:37 +0000, RichT <someone@somewhere.org>
wrote, quoted or indirectly quoted someone who said :

>All the examples I have read so far for Image stuff in Java have 
>everything stuffed into one monolithic class, and the crux of the 
>rendering seems to be done in paint(Graphics g) or 
>paintComponent(Graphics g) using a g2d object cast againg the parameter g.

have a look at http://mindprod.com/products.html#SCREWS 
too see some sample code.
-- 

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web