Im making a graph program and im stuck at where I need to get mouse coordinates to equal graphic scale. With picturebox I use transform to scale my graphic:
RectangleF world = new RectangleF(wxmin, wymin, wwid, whgt);
PointF[] device_points =
{
new PointF(0, PictureBox1.ClientSize.Height),
new PointF(PictureBox1.ClientSize.Width, PictureBox1.ClientSize.Height),
new PointF(0, 0),
};
Matrix transform = new Matrix(world, device_points);
gr.Transform = transform;
Im using MouseMove function. Is there a way to transform mouse coordinates? When I put my mouse on x=9 I need my mouse coordinate to be 9.
private void PictureBox1_MouseMove(object sender, MouseEventArgs e)
{
Console.WriteLine(e.X);
}