• 大小: 86KB
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2024-02-02
  • 语言: C#
  • 标签: 手写输入  

资源简介

c# 手写智能识别源代码

资源截图

代码片段和文件信息

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;

namespace handwriting
{
    public partial class Form1 : Form
    {
        bool hw;
        Graphics g;
        Pen p = new Pen(Color.Lime);
        int x1 y1 x2 y2;
        public Form1()
        {
            InitializeComponent();
        }

        private void comboBox1_SelectedIndexChanged(object sender EventArgs e)
        {
            switch (comboBox1.SelectedIndex)
            {
                case 0:
                   p.Width = 1;
                    break;
                case 1:
                    p.Width = 2;
                    break;
                case 2:
                    p.Width = 3;
                    break;
                case 3:
                    p.Width = 5;
                    break;
                case 4:
                    p.Width = 15;
                    break;


            }
        }


        private void pictureBox1_MouseUp(object sender MouseEventArgs e)
        {
            hw = false;
        }

        private void pictureBox1_MouseMove(object sender MouseEventArgs e)
        {
           
            g = pictureBox1.CreateGraphics();
          
            if (hw)
            {
                x2 = e.X;
                y2 = e.Y;
                g.DrawLine(p x1 y1 x2 y2);
                x1 = x2;
                y1 = y2;
            }
        }

        private void pictureBox1_MouseDown(object sender MouseEventArgs e)
        {
            hw = true;
            x1 = e.X;
            y1 = e.Y;
        }

        private void button1_Click(object sender EventArgs e)
        {
            pictureBox1.Refresh();
        }

        private void button2_Click(object sender EventArgs e)
        {
            Bitmap bmp = new Bitmap(pictureBox1.Width pictureBox1.Height);
            pictureBox1.DrawToBitmap(bmp pictureBox1.Bounds);
            bmp.Save(“test.bmp“System.Drawing.Imaging.ImageFormat.Bmp );
       
        }

        private void pictureBox2_Click(object sender EventArgs e)
        {
            p.Color = Color.Red;
        }

        private void pictureBox3_Click(object sender EventArgs e)
        {
            p.Color = Color.YellowGreen;
        }

        private void pictureBox4_Click(object sender EventArgs e)
        {
            p.Color = Color.LightSteelBlue;
        }

        private void pictureBox5_Click(object sender EventArgs e)
        {
            p.Color = Color.Yellow;
        }

        private void Form1_Load(object sender EventArgs e)
        {
            g = pictureBox1.CreateGraphics();
            p = new Pen(Color.Lime);
            hw = false;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-12-22 17:31  c# 手写输入源代码\
     目录           0  2011-05-17 13:57  c# 手写输入源代码\handwriting\
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\.vs\
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\.vs\handwriting\
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\.vs\handwriting\v14\
     文件       20992  2017-09-26 10:59  c# 手写输入源代码\handwriting\handwriting\.vs\handwriting\v14\.suo
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\Backup\
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\
     文件        9624  2011-05-24 12:02  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Form1.Designer.cs
     文件        2920  2011-05-24 12:03  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Form1.cs
     文件        5814  2011-05-24 12:02  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Form1.resx
     文件         492  2011-05-17 13:57  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Program.cs
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Properties\
     文件        1354  2011-05-17 13:57  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Properties\AssemblyInfo.cs
     文件        3350  2011-05-24 12:03  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Properties\Resources.Designer.cs
     文件        6438  2011-05-17 16:19  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Properties\Resources.resx
     文件        1109  2011-05-24 12:03  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Properties\Settings.Designer.cs
     文件         249  2011-05-17 13:57  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Properties\Settings.settings
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Resources\
     文件      202262  2011-05-17 16:15  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\Resources\test.BMP
     文件        3879  2011-05-24 12:05  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting\huatu.csproj
     文件         911  2011-05-24 11:58  c# 手写输入源代码\handwriting\handwriting\Backup\handwriting.sln
     文件       42060  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\UpgradeLog.htm
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\handwriting\
     文件        9624  2011-05-24 12:02  c# 手写输入源代码\handwriting\handwriting\handwriting\Form1.Designer.cs
     文件        2920  2011-05-24 12:03  c# 手写输入源代码\handwriting\handwriting\handwriting\Form1.cs
     文件        5814  2011-05-24 12:02  c# 手写输入源代码\handwriting\handwriting\handwriting\Form1.resx
     文件         492  2011-05-17 13:57  c# 手写输入源代码\handwriting\handwriting\handwriting\Program.cs
     目录           0  2017-09-26 10:55  c# 手写输入源代码\handwriting\handwriting\handwriting\Properties\
     文件        1354  2011-05-17 13:57  c# 手写输入源代码\handwriting\handwriting\handwriting\Properties\AssemblyInfo.cs
............此处省略29个文件信息

评论

共有 条评论