using (RasterCodecs codecs = new RasterCodecs())
{
codecs.Options.RasterizeDocument.Load.XResolution = 300;
codecs.Options.RasterizeDocument.Load.YResolution = 300;
RasterImage image = codecs.Load(inputFile);
using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Professional, false))
{
ocrEngine.Startup(null, null, null, @"C:\LEADTOOLS 19\Bin\Common\OcrProfessionalRuntime64");
using (IOcrDocument document = ocrEngine.DocumentManager.CreateDocument())
{
document.Pages.AddPage(image, null);
document.Pages[0].Recognize(null);
IOcrPageCharacters pageCharacters = document.Pages[0].GetRecognizedCharacters();
for (int i = 0; i < document.Pages[0].Zones.Count; i++)
{
IOcrZoneCharacters zoneCharacters = pageCharacters.FindZoneCharacters(i);
if (zoneCharacters != null)
{
foreach (var ocrCharacter in zoneCharacters)
{
OcrCharacterPosition position;
position = ocrCharacter.Position;
if ((position & OcrCharacterPosition.EndOfLine) == OcrCharacterPosition.EndOfLine)
{
Console.Write(ocrCharacter.Code + "\n");
}
else
{
Console.Write(ocrCharacter.Code);
}
}
}
}
}
}
}2017慧都十四周年狂欢搞事情!砸金蛋100%抽现金红包、满额豪送iPhone X、iPhone 8、DevExpress汉化免费送、团队升级培训套包劲省10万元......更多惊喜等您来探索!
主题切换选项用于渲染和可视化所有可用的JavaScript主题中的组件。
































CAD.NET是一个在.NET环境中提供解决方案的库, 它支持AutoCAD®DWG,DXF,PLT及其它CAD格式。 | |
CADViewX一款能让应用程序 具有强大CAD图像浏览和打印 功能的图像处理工具。 | ABViewer是一款高质量的2D/3D文档查看器, 可提供专业的浏览、编辑和转换功能, 支持30多种光栅和矢量图形格式。 |
CAD EditorX提供易用 的API和大量的示例方便开发者快速集成。 | CAD VCL Enterprise是一个 高品质多功能且含源码的控件。 |
用于通过Internet、Intranet、 Sharepoint、Office 365 及其他在线 HTML5 启用技术查看DWG和其他CAD文件。 | CAD DLL是一个为开发者打造的 新版本CAD库,可在支持动态链接 库技术的语言中添加CAD功能到应用程序中。 |
AnyMap的可交互式地图是AnyChart组件的一种独特的功能,能够让你可视化地理相关的数据。(重要推荐:AnyMap已加入在线订购,超值特价低至¥368起!)





































using System.Windows.Forms; using Leadtools; using Leadtools.Codecs; using Leadtools.WinForms; using Leadtools.Annotations;
RasterImageViewer viewer = new RasterImageViewer();
RasterImage img;
AnnAutomationManager annger;
AnnAutomation automation;private void initControl() {
Support.SetLicense();
viewer.Dock = DockStyle.Fill;
panel1.Controls.Add(viewer);
viewer.HorizontalAlignMode = RasterPaintAlignMode.Center;
viewer.VerticalAlignMode = RasterPaintAlignMode.Center;
loadImage("qwe.jpg");
if (viewer.Image != null)
{
// create and setup the automation manager
annger = new AnnAutomationManager();
// Instruct the manager to create the default (all) automation objects.
annger.CreateDefaultObjects();
// create the toolbar and add it to the form
annger.CreateToolBar();
Controls.Add(annger.ToolBar);
// setup the automation (will create the container as well)
automation = new AnnAutomation(annger, viewer);
// add an event handler for changes to the current designer
automation.CurrentDesignerChanged += new EventHandler(automation_CurrentDesignerChanged);
// setup this automation as the active one
automation.Active = true;
}
toolStripComboBox1.SelectedIndex = 0;
}
private void loadImage(string filename)
{
img = new RasterCodecs().Load(filename);
viewer.Image = img;
}
private void automation_CurrentDesignerChanged(object sender, EventArgs e)
{
AnnAutomation automation = sender as AnnAutomation;
AnnButtonRunDesigner buttonRunDesigner = automation.CurrentDesigner as AnnButtonRunDesigner;
if (buttonRunDesigner != null)
buttonRunDesigner.Run += new EventHandler(buttonRunDesigner_Run);
}private void buttonRunDesigner_Run(object sender, AnnRunDesignerEventArgs e)
{
if (e.OperationStatus == AnnDesignerOperationStatus.End)
{
AnnButtonObject btn = e.Object as AnnButtonObject;
MessageBox.Show(string.Format("Button with text = {0} was clicked!", btn.Text));
}
}
private void loadImage(string filename)
{
img = new RasterCodecs().Load(filename);
viewer.Image = img;
}
private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
annger.UserMode = (toolStripComboBox1.SelectedIndex == 0) ? AnnUserMode.Design : AnnUserMode.Run;
}
