java Programming Glossary: g.draw
Java - How to draw a transparent shape using a Graphics object g? http://stackoverflow.com/questions/10852959/java-how-to-draw-a-transparent-shape-using-a-graphics-object-g g.setClip circle g.drawImage imageFG 0 0 null g.setClip null Stroke s new BasicStroke.. s new BasicStroke 2 g.setStroke s g.setColor Color.BLACK g.draw circle g.dispose JLabel l new JLabel new ImageIcon imageBG JOptionPane.showMessageDialog..
Get mouse detection with a dynamic shape http://stackoverflow.com/questions/13795236/get-mouse-detection-with-a-dynamic-shape mouse g.setColor inside else g.setColor outside g.draw shape g.setColor Color.RED int x int mouse.getX int y int mouse.getY.. int y int mouse.getY g.setStroke new BasicStroke 2 int s 3 g.drawLine x s y x s y g.drawLine x y s x y s l.setIcon new ImageIcon.. new BasicStroke 2 int s 3 g.drawLine x s y x s y g.drawLine x y s x y s l.setIcon new ImageIcon img g.dispose try ImageIO.write..
Save Java2D to SWF (flash) http://stackoverflow.com/questions/267001/save-java2d-to-swf-flash Font font new Font Serif Font.PLAIN 16 g.setFont font g.drawString Test swf 30 30 g.draw new Line2D.Double 5 5 50 60 g.draw.. Font.PLAIN 16 g.setFont font g.drawString Test swf 30 30 g.draw new Line2D.Double 5 5 50 60 g.draw new Line2D.Double 50 60 150.. Test swf 30 30 g.draw new Line2D.Double 5 5 50 60 g.draw new Line2D.Double 50 60 150 40 g.draw new Line2D.Double 150..
Image/Graphic into a Shape http://stackoverflow.com/questions/7052422/image-graphic-into-a-shape null g.setStroke new BasicStroke 1 g.setColor Color.blue g.draw area return result public static BufferedImage createAndWrite..
Smoothing a jagged path http://stackoverflow.com/questions/7218309/smoothing-a-jagged-path g.setColor Color.BLACK g.setClip null g.draw areaOutline g.dispose public Area getOutline Color target BufferedImage.. Graphics2D g imageTwoTone.createGraphics g.drawImage image twoToneFilter 0 0 g.dispose public static void main..
Line2D decoration tips needed - Graphics2D http://stackoverflow.com/questions/7342979/line2d-decoration-tips-needed-graphics2d 0 0 size size g.setColor Color.BLACK g.setStroke thick g.draw line1 g.setColor Color.WHITE g.setStroke thinner g.draw line1.. g.draw line1 g.setColor Color.WHITE g.setStroke thinner g.draw line1 ImageIO.write bi png new File img.png SwingUtilities.invokeLater..
Animating dashed-line with java.awt.BasicStroke http://stackoverflow.com/questions/9771924/animating-dashed-line-with-java-awt-basicstroke height g.setColor Color.BLACK g.setStroke dashedStroke g.draw rectangle g.dispose label.repaint if dashPhase 100f try..
|