Exemplo n.º 1
0
        private void PictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            gr.Clear(Color.White);
            UpdateDraw();

            gr.DrawLine(new Pen(Color.Yellow), new System.Drawing.Point(e.X, 0), new System.Drawing.Point(e.X, pictureBox1.Height));
            gr.DrawLine(new Pen(Color.Yellow), new System.Drawing.Point(0, e.Y), new System.Drawing.Point(pictureBox1.Width, e.Y));


            Approximation.Point tmp = new Approximation.Point((double)(e.X - px) / 40, (double)(py - e.Y) / 40);
            gr.DrawString($"Mouse x coord: {tmp.X}", SystemFonts.MenuFont, Brushes.Red, new Approximation.Point(10, 10));
            gr.DrawString($"Mouse y coord: {tmp.Y}", SystemFonts.MenuFont, Brushes.Red, new Approximation.Point(10, 30));
        }
Exemplo n.º 2
0
 Approximation.Point ScaleTransform(Approximation.Point p)
 {
     return(new Approximation.Point(p.X * 40 + px, py - p.Y * 40));
 }
Exemplo n.º 3
0
 Approximation.Point TransformCoords(Approximation.Point p)
 {
     return(new Approximation.Point(p.X + px, py - p.Y));
 }