parent
992620e1ce
commit
eecfcc25fa
@ -0,0 +1,29 @@ |
||||
using Tesseract; |
||||
|
||||
namespace TessaractTest |
||||
{ |
||||
public partial class Form1 : Form |
||||
{ |
||||
public Form1() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
private void btnLoad_Click(object sender, EventArgs e) |
||||
{ |
||||
OpenFileDialog dlg = new OpenFileDialog(); |
||||
if (dlg.ShowDialog() != DialogResult.OK) |
||||
return; |
||||
|
||||
string filePath = dlg.FileName; |
||||
pbxMain.Load(filePath); |
||||
pbxMain.SizeMode = PictureBoxSizeMode.Zoom; |
||||
|
||||
Pix pix = Pix.LoadFromFile(filePath); |
||||
TesseractEngine ocr = new TesseractEngine("./tessdata", "kor", EngineMode.Default); |
||||
Page page = ocr.Process(pix); |
||||
|
||||
tbxMain.Text = page.GetText(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,17 @@ |
||||
namespace TessaractTest |
||||
{ |
||||
internal static class Program |
||||
{ |
||||
/// <summary> |
||||
/// The main entry point for the application. |
||||
/// </summary> |
||||
[STAThread] |
||||
static void Main() |
||||
{ |
||||
// To customize application configuration such as set high DPI settings or default font, |
||||
// see https://aka.ms/applicationconfiguration. |
||||
ApplicationConfiguration.Initialize(); |
||||
Application.Run(new Form1()); |
||||
} |
||||
} |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue