Hi,
I don't know C# very well, so I did^n't understand where the problem is. Program works without errors. But it doesn't do what I want, when I click on panel1 , not draws rectangle.
Maybe, you can realise something wrong in the code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace bezier_rotation
{
public partial class Form1 : Form
{
private List<double> ptList = new List<double>();
private BezierCurve bc = new BezierCurve();
OpenGLView ogl;
public Form1()
{
InitializeComponent();
ogl = new OpenGLView();
ogl.Parent = panel1;
ogl.Dock = DockStyle.Fill;
ogl.Refresh();
}
Pen px = new Pen(Brushes.Red);
Pen newpx = new Pen(Brushes.Magenta);
Graphics g;
private void Form1_Load_1(object sender, EventArgs e)
{
g = Graphics.FromHwnd(panel1.Handle);
}
private void trackX_Scroll(object sender, EventArgs e)
{
ogl.setAngleX(trackX.Value);
lblX.Text = ogl.getAngleX().ToString();
ogl.Refresh();
}
private void trackY_Scroll(object sender, EventArgs e)
{
ogl.setAngleY(trackY.Value);
lblY.Text = ogl.getAngleY().ToString();
ogl.Refresh();
}
private void trackZ_Scroll(object sender, EventArgs e)
{
ogl.setAngleZ(trackZ.Value);
lblZ.Text = ogl.getAngleZ().ToString();
ogl.Refresh();
}
private void panel1_MouseClick_1(object sender, MouseEventArgs e)
{
//MessageBox.Show("2VELÄ°");
ptList.Add(e.X);
ptList.Add(e.Y);
g.DrawRectangle(px, new Rectangle(e.X, e.Y, 1, 1));
}
}
}