代码:
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) 我有两个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)