小编use*_*062的帖子

如何将浮点变量添加到List <Point>?

代码:

public static List<Point> Load()
{
    List<float> Points_X = new List<float>();
    List<float> Points_Y = new List<float>();
    int ImageWidth;
    int ImageHeight;
    double CurrentFactor;
    path = Path.GetDirectoryName(Application.LocalUserAppDataPath) + "\\Data";

    if (!Directory.Exists(path))
    {
        Directory.CreateDirectory(path);
    }

    file = Path.GetDirectoryName(Application.LocalUserAppDataPath) + "\\Data" + "\\Data.txt";

    OptionsFile setting_file = new OptionsFile(file);
    Points_X = setting_file.GetListFloatKey("Points Coordinates X");
    Points_Y = setting_file.GetListFloatKey("Points Coordinates Y");
    ImageWidth = int.Parse(setting_file.GetKey("Image Width"));
    ImageHeight= int.Parse(setting_file.GetKey("Image Height"));
    CurrentFactor = double.Parse(setting_file.GetKey("Current Factor"));

    var points = new List<Point>();
    for (int i = 0; i < Points_X.Count; i++)
    { …
Run Code Online (Sandbox Code Playgroud)

c# winforms

0
推荐指数
1
解决办法
515
查看次数

如何计算两点之间的直线长度?

我有两个Point变量.开始和结束.

例如,起点是121,100,终点是140,122

我在两点之间划了一条线.我如何找到两点之间的线长?

在pictureBox1鼠标向下我做了:

start = e.Location;
Run Code Online (Sandbox Code Playgroud)

在pictureBox1鼠标上我做了:

end = e.Location;
Run Code Online (Sandbox Code Playgroud)

c# winforms

-4
推荐指数
1
解决办法
4203
查看次数

标签 统计

c# ×2

winforms ×2