C# c sql查询问题
这是OCR。我的系统允许用户输入由字符组成的图像,填写特定字符和描述。输入数据将插入数据库。这里是我的问题,如果用户想要输入一个具有相同字符但字体不同的图像,他们不需要重新键入字符和描述。他们可能只需要使用导入按钮即可导入现有图像,让系统知道两个字符是相同的。因此,当用户输入图像供系统扫描时,系统可能知道不同字体的字符 那么,当用户导入现有字符时,我如何对系统进行编码以通知系统字符是相同的 区域库培训AB2_组件C# c sql查询问题,c#,sql,C#,Sql,这是OCR。我的系统允许用户输入由字符组成的图像,填写特定字符和描述。输入数据将插入数据库。这里是我的问题,如果用户想要输入一个具有相同字符但字体不同的图像,他们不需要重新键入字符和描述。他们可能只需要使用导入按钮即可导入现有图像,让系统知道两个字符是相同的。因此,当用户输入图像供系统扫描时,系统可能知道不同字体的字符 那么,当用户导入现有字符时,我如何对系统进行编码以通知系统字符是相同的 区域库培训AB2_组件 如果我误解了您的问题,请原谅,但您似乎需要一个多表数据库来完成这项工作 一个例子
如果我误解了您的问题,请原谅,但您似乎需要一个多表数据库来完成这项工作 一个例子 用户+字体细节我不明白什么是字体细节 上传详细信息,如扫描项目 就数据库而言,这样做可能更有用 使用者 图像细节 用户标识和图像标识之间的链接 您可以做的不是重置描述和字符等,而是询问他们是否希望基于同一图像插入另一个
我没有真正理解其中的字体部分。我的意思是,用户输入图像、字符和描述。然后,如果用户希望输入另一个具有相同字符和描述的图像,则用户只需导入现有图像,告诉系统字符和描述是相同的,这样他们就不需要再次输入字符和描述。
private void Browse1_Click(object sender, EventArgs e)
{
try
{
//open file dialog for the users to input image to the system
OpenFileDialog open = new OpenFileDialog();
//Set default directory to the open file dialog
open.InitialDirectory = @"C:\Users\Shen\Desktop";
//limit input image type for the users
open.Filter = "Image Files(*.jpg; *.jpeg)|*.jpg; *.jpeg";
if (open.ShowDialog() == DialogResult.OK)
{
singleFileInfo = new FileInfo(open.FileName);
string dirName = System.IO.Path.GetDirectoryName(open.FileName);
imgLoc.Text = open.FileName;
}
}
catch (Exception)
{
throw new ApplicationException("Failed loading image");
}
}
private void typeRadio_CheckedChanged(object sender, EventArgs e)
{
//set the textbox to editable and the "import" button unclickable when user select the "Type Character" radio button
CharTB.ReadOnly = false;
ImportButton.Enabled = false;
DescTB.ReadOnly = false;
}
private void importRadio_CheckedChanged(object sender, EventArgs e)
{
//set the "import" button to clickable and the textbox to uneditable when the user select "Import Existing" radio button
ImportButton.Enabled = true;
CharTB.ReadOnly = true;
DescTB.ReadOnly = true;
}
private void AddBt_Click(object sender, EventArgs e)
{
con = new System.Data.SqlClient.SqlConnection();
con.ConnectionString = "Data Source=SHEN-PC\\SQLEXPRESS;Initial Catalog=CharacterImage;Integrated Security=True";
con.Open();
//set variables to the textbox.text
String ImageLocation = imgLoc.Text;
String typeName = CharTB.Text;
String ImportExt = importTB.Text;
String CharDesc = DescTB.Text;
String fileName = System.IO.Path.GetFileName(ImageLocation);
String savePath = @"C:\Users\Shen\Desktop\LenzOCR\LenzOCR\WindowsFormsApplication1\ImageFile\" + fileName;
inputImageBox.Image = Image.FromFile(ImageLocation);
inputImageBox.Image.Save(savePath);
String insertData = "INSERT INTO CharacterImage(ImageName, ImagePath, Character, CharacterDescription) VALUES('"+fileName+"', '"+savePath+"', '"+typeName+"', '"+CharDesc+"')";
SqlCommand cmd = new SqlCommand(insertData, con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Character Inserted", "Insert Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
descDisplayTB.Text = typeName + "\r\n\r\n" + CharDesc;
//set the Textbox to empty and the "Type Character" textboxt to uneditable
//and the "Import" button to unclickable after user add the data into the database
imgLoc.Text = "";
CharTB.Text = "";
importTB.Text = "";
DescTB.Text = "";
CharTB.ReadOnly = true;
ImportButton.Enabled = false;
}
private void button2_Click(object sender, EventArgs e)
{
descDisplayTB.Text = "";
pictureBox1.Image = null;
}
#endregion