Example #1
0
 public virtual void  drawLine(Line line, int color)
 {
     System.Drawing.Graphics g2d = System.Drawing.Graphics.FromImage(image);
     //UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
     SupportClass.GraphicsManager.manager.SetColor(g2d, System.Drawing.Color.FromArgb(color));
     g2d.drawLine(line.getP1().getX(), line.getP1().getY(), line.getP2().getX(), line.getP2().getY());
     //UPGRADE_TODO: Method 'java.awt.Component.repaint' was converted to 'System.Windows.Forms.Control.Refresh' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentrepaint'"
     Refresh();
 }
Example #2
0
    //UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
    public virtual void  drawCross(ref System.Drawing.Point point, int color)
    {
        //UPGRADE_TODO: Method 'java.awt.Point.getX' was converted to 'System.Drawing.Point.X' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtPointgetX'"
        int x = (int)(point.X);
        //UPGRADE_TODO: Method 'java.awt.Point.getY' was converted to 'System.Drawing.Point.Y' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtPointgetY'"
        int y = (int)(point.Y);

        Line[] lines = new Line[] { new Line(x - 5, y - 1, x + 5, y - 1), new Line(x - 1, y - 5, x - 1, y + 5), new Line(x - 5, y + 1, x + 5, y + 1), new Line(x + 1, y - 5, x + 1, y + 5), new Line(x - 5, y, x + 5, y), new Line(x, y - 5, x, y + 5) };
        drawLines(lines, color);
    }
Example #3
0
    public virtual void  drawLine(Line line, int color)
    {
        Image    bufImage = Image.createImage(image.getWidth(), image.getHeight());
        Graphics g        = bufImage.getGraphics();

        g.drawImage(image, 0, 0, 0);
        g.setColor(color);
        g.drawLine(line.getP1().getX(), line.getP1().getY(), line.getP2().getX(), line.getP2().getY());
        image = bufImage;
        repaint();
    }
	//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
	public virtual void  drawCross(ref System.Drawing.Point point, int color)
	{
		//UPGRADE_TODO: Method 'java.awt.Point.getX' was converted to 'System.Drawing.Point.X' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtPointgetX'"
		int x = (int) (point.X);
		//UPGRADE_TODO: Method 'java.awt.Point.getY' was converted to 'System.Drawing.Point.Y' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtPointgetY'"
		int y = (int) (point.Y);
		
		Line[] lines = new Line[]{new Line(x - 5, y - 1, x + 5, y - 1), new Line(x - 1, y - 5, x - 1, y + 5), new Line(x - 5, y + 1, x + 5, y + 1), new Line(x + 1, y - 5, x + 1, y + 5), new Line(x - 5, y, x + 5, y), new Line(x, y - 5, x, y + 5)};
		drawLines(lines, color);
	}
	public virtual void  drawLines(Line[] lines, int color)
	{
		System.Drawing.Graphics g2d = System.Drawing.Graphics.FromImage(image);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		SupportClass.GraphicsManager.manager.SetColor(g2d, System.Drawing.Color.FromArgb(color));
		for (int i = 0; i < lines.length; i++)
		{
			g2d.drawLine(lines[i].getP1().getX(), lines[i].getP1().getY(), lines[i].getP2().getX(), lines[i].getP2().getY());
		}
		//UPGRADE_TODO: Method 'java.awt.Component.repaint' was converted to 'System.Windows.Forms.Control.Refresh' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentrepaint'"
		Refresh();
	}
    public virtual void drawLines(Line[] lines, int color)
    {
        Image bufImage = Image.createImage(image.getWidth(), image.getHeight());
        Graphics g = bufImage.getGraphics();
        g.drawImage(image, 0, 0, 0);
        g.setColor(color);

        for (int i = 0; i < lines.length - 1; i++)
        {
            g.drawLine(lines[i].getP1().getX(), lines[i].getP1().getY(), lines[i].getP2().getX(), lines[i].getP2().getY());
        }
        image = bufImage;
        repaint();
    }
 public virtual void drawLine(Line line, int color)
 {
     Image bufImage = Image.createImage(image.getWidth(), image.getHeight());
     Graphics g = bufImage.getGraphics();
     g.drawImage(image, 0, 0, 0);
     g.setColor(color);
     g.drawLine(line.getP1().getX(), line.getP1().getY(), line.getP2().getX(), line.getP2().getY());
     image = bufImage;
     repaint();
 }