资源简介
C#抓屏识别汉字,调用微软MODI, 已解决OCR running error问题

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Threading;
using System.Data.OleDb;
//using System.IO.MemoryMappedFiles;
//using System.Runtime.InteropServices;
//using System.Threading.Tasks;
namespace mergebmp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
MyWin m_WindowDlg;
public static Image imgBack;
///
/// 合并图片
public static Bitmap CombinImage(Image imgBack Image img int xDeviation = 0 int yDeviation = 0)
{
Bitmap bmp = new Bitmap(imgBack.Width imgBack.Height);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
g.DrawImage(imgBack 0 0 imgBack.Width imgBack.Height);
g.DrawImage(img 0 0 img.Width img.Height);
GC.Collect();
return bmp;
}
private void button2_Click(object sender EventArgs e)
{
Thread_Time.Dispose();
return;
}
public static Image Rescale(Image image int dpiX int dpiY)
{
Bitmap bm = new Bitmap((int)(image.Width * dpiX / image.HorizontalResolution) (int)(image.Height * dpiY / image.VerticalResolution));
bm.SetResolution(dpiX dpiY);
Graphics g = Graphics.FromImage(bm);
g.InterpolationMode = InterpolationMode.Bicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.DrawImage(image 0 0);
g.Dispose();
return bm;
}
private static System.Drawing.Image resizeImage(System.Drawing.Image imgToResize Size size)
{
//获取图片宽度
int sourceWidth = imgToResize.Width;
//获取图片高度
int sourceHeight = imgToResize.Height;
float nPercent = 0;
float nPercentW = 0;
float nPercentH = 0;
//计算宽度的缩放比例
nPercentW = ((float)size.Width / (float)sourceWidth);
//计算高度的缩放比例
nPercentH = ((float)size.Height / (float)sourceHeight);
if (nPercentH < nPercentW)
nPercent = nPercentH;
else
nPercent = nPercentW;
//期望的宽度
int destWidth = (int)(sourceWidth * nPercent);
//期望的高度
int destHeight = (int)(sourceHeight * nPercent);
Bitmap b = new Bitmap(destWidth destHeight);
Graphics g = Graphics.FromImage((System.Drawing.Image)b);
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
//绘制图像
g.DrawImage(imgToResize 0 0 de
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11541 2019-01-07 16:09 Form1.Designer.cs
文件 5817 2019-01-07 16:09 Form1.resx
文件 7173 2018-12-22 21:37 GrayBMP_File.cs
文件 714 2016-05-07 19:12 ImageConverter.cs
文件 28977 2019-01-07 16:08 ImageHelper.cs
文件 478 2018-12-25 12:20 mergebmp.csproj.user
文件 3588 2018-12-22 17:29 MyWin.cs
文件 1943 2018-12-22 17:29 MyWin.Designer.cs
文件 5814 2018-12-22 10:24 MyWin.resx
文件 489 2018-12-21 21:15 Program.cs
文件 7590 2019-01-07 16:28 testbmp.csproj
目录 0 2019-01-07 16:30 bin\Debug\
文件 35328 2019-01-07 16:28 bin\Debug\mergebmp.exe
文件 60928 2019-01-07 16:28 bin\Debug\mergebmp.pdb
文件 11600 2019-01-07 16:30 bin\Debug\mergebmp.vshost.exe
文件 490 2010-03-17 22:39 bin\Debug\mergebmp.vshost.exe.manifest
文件 3320 2019-01-07 16:28 bin\Debug\temp2831956.tif
文件 3648 2019-01-07 16:30 bin\Debug\temp3019909.tif
目录 0 2019-01-07 16:28 obj\Debug\
文件 6463 2019-01-07 16:30 obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 596 2019-01-07 16:28 obj\Debug\GenerateResource.read.1.tlog
文件 1524 2019-01-07 16:28 obj\Debug\GenerateResource.write.1.tlog
文件 33280 2019-01-07 16:26 obj\Debug\Interop.MODI.dll
文件 35328 2019-01-07 16:28 obj\Debug\mergebmp.exe
文件 180 2019-01-07 16:28 obj\Debug\mergebmp.Form1.resources
文件 180 2019-01-07 16:28 obj\Debug\mergebmp.MyWin.resources
文件 60928 2019-01-07 16:28 obj\Debug\mergebmp.pdb
文件 2784 2019-01-07 16:28 obj\Debug\mergebmp.Properties.Resources.resources
目录 0 2019-01-07 16:28 obj\Debug\TempPE\
文件 4608 2019-01-07 16:28 obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 1010 2019-01-07 16:30 obj\Debug\testbmp.csproj.FileListAbsolute.txt
............此处省略11个文件信息
相关资源
- VS插件源码JSLint(JS辅助工具)
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- Asp.net学生信息管理系统源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- Winform可视化打印模板设计工具含源码
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
评论
共有 条评论