基于C#实现Winform界面调用名片识别接口
更新时间:2023-10-22 11:14:01 阅读量: 综合文库 文档下载
基于C#实现Winform界面调用名片识别接口
本程序适用于聚合名片识别接口:http://www.juhe.cn/docs/api/id/139
注:项目中如遇无法引用 System.Web.dll 问题,修改“项目属性”-“应用程序”-“目标框架” ,由“.NET Framework 4 Client Profile”修改为“.NET Framework 4”。然后再引用 .NET 4.0 的 System.Web.dll 即可
前台界面代码:
namespace mingpianshibie {
partial class Form1 {
///
/// Required designer variable. ///
private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used. ///
///
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose(); }
base.Dispose(disposing); }
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify /// the contents of this method with the code editor. ///
private void InitializeComponent()
{
this.open = new System.Windows.Forms.Button(); this.pixel = new System.Windows.Forms.Button();
this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.ImgToBase64 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.label1 = new System.Windows.Forms.Label(); this.lb_show = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout(); this.SuspendLayout(); //
// open //
this.open.Location = new System.Drawing.Point(414, 29); this.open.Name = \;
this.open.Size = new System.Drawing.Size(112, 29); this.open.TabIndex = 0;
this.open.Text = \选择图片\;
this.open.UseVisualStyleBackColor = true;
this.open.Click += new System.EventHandler(this.open_Click); //
// pixel //
this.pixel.Location = new System.Drawing.Point(414, 92); this.pixel.Name = \;
this.pixel.Size = new System.Drawing.Size(112, 29); this.pixel.TabIndex = 3;
this.pixel.Text = \灰度化处理\;
this.pixel.UseVisualStyleBackColor = true;
this.pixel.Click += new System.EventHandler(this.pixel_Click);
//
// pictureBox2 //
this.pictureBox2.Location = new System.Drawing.Point(6, 141);
this.pictureBox2.Name = \;
this.pictureBox2.Size = new System.Drawing.Size(373, 113);
this.pictureBox2.TabIndex = 5; this.pictureBox2.TabStop = false; //
// pictureBox1 //
this.pictureBox1.Location = new System.Drawing.Point(6, 17); this.pictureBox1.Name = \;
this.pictureBox1.Size = new System.Drawing.Size(373, 110); this.pictureBox1.TabIndex = 4; this.pictureBox1.TabStop = false; //
// ImgToBase64 //
this.ImgToBase64.Location = new System.Drawing.Point(414, 153);
this.ImgToBase64.Name = \;
this.ImgToBase64.Size = new System.Drawing.Size(112, 29); this.ImgToBase64.TabIndex = 6;
this.ImgToBase64.Text = \图片Base64转换\;
this.ImgToBase64.UseVisualStyleBackColor = true;
this.ImgToBase64.Click += new System.EventHandler(this.ImgToBase64_Click); //
// button2 //
this.button2.Location = new System.Drawing.Point(414, 216); this.button2.Name = \;
this.button2.Size = new System.Drawing.Size(112, 29); this.button2.TabIndex = 7;
this.button2.Text = \名片识别\;
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click_1);
//
// groupBox1 //
this.groupBox1.BackColor = System.Drawing.SystemColors.Control;
this.groupBox1.Controls.Add(this.pictureBox1); this.groupBox1.Controls.Add(this.pictureBox2);
this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = \;
this.groupBox1.Size = new System.Drawing.Size(396, 260); this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = \图片展示\; //
// label1 //
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 299); this.label1.Name = \;
this.label1.Size = new System.Drawing.Size(65, 12); this.label1.TabIndex = 9;
this.label1.Text = \识别结果:\; //
// lb_show //
this.lb_show.AutoSize = true;
this.lb_show.Location = new System.Drawing.Point(106, 299); this.lb_show.Name = \;
this.lb_show.Size = new System.Drawing.Size(0, 12); this.lb_show.TabIndex = 10; //
// Form1 //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(553, 348); this.Controls.Add(this.lb_show); this.Controls.Add(this.label1); this.Controls.Add(this.groupBox1); this.Controls.Add(this.button2);
this.Controls.Add(this.ImgToBase64); this.Controls.Add(this.pixel); this.Controls.Add(this.open);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = \;
this.Text = \名片识别\;
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox1.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button open; private System.Windows.Forms.Button pixel;
private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Button ImgToBase64; private System.Windows.Forms.Button button2;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label lb_show; }
}
后台代码:
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing;
using System.Drawing.Imaging; using System.Text;
using System.Windows.Forms; using System.IO; using System.Net;
using System.Net.Security; using System.Web;
using System.Security.Cryptography.X509Certificates; using System.Diagnostics;
namespace mingpianshibie {
public partial class Form1 : Form {
Bitmap curBitmap; Bitmap bitmap;
String strbaser64; public Form1() {
正在阅读:
新泰市第一中学2016届高三上学期第一次质量检测试题(历史)11-03
浅谈语文教学中评价的几点问题11-09
2013版用于立项固态及半固态食品无菌包装设备项目可行性研究报告(甲级资质)审查要求及编制方案08-06
锅炉工培训补充讲义05-24
司考百问百答09-26
2018年气动气缸行业现状及发展趋势分析 (目录)07-08
2018学校法制工作计划05-06
智能循迹避障小车设计 - 图文12-31
信捷产品在弧形锯加工系统中的应用05-03
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- C#
- 调用
- 识别
- 界面
- 名片
- 接口
- 基于
- Winform
- 实现
- 信息安全题库
- 商品房买卖合同纠纷起诉书答辩状代理词
- 整顿和规范矿产资源开发秩序工作先进集体和先进个人名单
- 新中国成立以来经济发展成就
- 正弦信号发生器设计 - 图文
- 2013幼儿游戏与玩具参考答案
- 哈工大2009春季钢结构基本原理及设计试题
- 15.阿特斯阳高光伏电站电网故障保厂用电应急预案
- 三年级上册科学教学工作计划
- 中考语文必备资料:病句修改练习100例(附答案解析)(1)
- 调 查 笔 录- 大理白族自治州人民政府门户网站
- 汉中市蔬菜种植农场名录184家
- 戴德梁行海岸俊园定位建议书
- 仪器分析技术最新发展趋势及应用
- 广东电网公司各类规范
- 215轨道石门掘进技术报告()
- 祇、祗、只的区别
- 国际森林文书
- 中国的土地资源教学设计
- 消防大比武方案