|
How to draw a Shape using lines and curves |
|
|
This Java tip demonstrates a method of drawing basic shapes using lines and curves on
a Java component. The basic shapes can be drawn by a developer overwriting the paint() function
of the component.
// x, y, controlpointx, controlpointy,controlpointx1, controlpointy1,
// controlpointx2, controlpointy2 may be define by the developer
GeneralPath shape = new GeneralPath();
shape.moveTo(x, y);
shape.lineTo(x, y);
shape.quadTo(controlPointX, controlPointY, x, y);
shape.curveTo(controlPointX1, controlPointY1, controlPointX2,
controlPointY2, x, y);
shape.closePath();
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.