Hi, everybody, I just have some question regarding the java 2D rendering:

As we know, each time a Graphics2D rendering a shape, it retrieves a PathIterator from the shape and construct a rendering shape using the stroke setting. So my question is:

(1) If I have thousands of shape to draw on a layer, will it be too slow to repeat this procedure for each shape? I have tried to add all of them into one big GeneralPath, but this seems to lose the individual Shape’s info. (For example, you cannot do with the big GeneralPath with operations like selecting some shapes). I have to keep two copies of the coordinates: One in the big GeneralPath for rendering and one Vector of Shapes for individual Shape operations. It seems a bit stupid. I just wonder if there are better solutions.

(2) If I need to fill then draw an irregular Shape, how to let this procedure (retrieval of PathIterator and construction of rendering shape) only go once?

Thank you!

John

Reply via email to