读取含中文内容ini文件代码
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <cstring>
string outline_image_path;
LPCTSTR ini_path = "D:/cudaHygiene/image/带蓝芯弧形/带蓝芯弧形.ini";
//读取整型ini数据
int getInt(LPCTSTR lpKeyName, INT nDefault)
{
int value = GetPrivateProfileInt("Detection", lpKeyName, nDefault, ini_path);
return value;
}
//读取浮点型ini数据
double getDouble(LPCTSTR lpKeyName, LPCTSTR nDefault)
{
//读取字符型ini数据
char value[20];
GetPrivateProfileString("Detection", lpKeyName, nDefault, value, sizeof(value), ini_path);
//转为double型
return strtod(value, NULL);
}
void read_ini()
{
int model_flag = getInt("model_flag", 0);
int filter_flag = getInt("model_flag", 0);
int defect_distance = getInt("defect_distance", 1);
int defect_height = getInt("defect_height", 1);
int defect_width = getInt("defect_width", 1);
double Zoom_f