• 大小: 134KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: C#
  • 标签: c#  

资源简介

字形轮廓提取显示C#源码(0515).rar

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using TrueTypeText.Drawing;
using TrueTypeText.Outline.Data;
using TrueTypeText.Outline;

namespace TrueTypeText
{
    public partial class MainForm : Form
    {
        private IList wordOutlines;
        private Graphics graphics = null;
        private float lineWidth = 1f;

        public MainForm()
        {
            InitializeComponent();
            wordOutlines = new List();

            Font font = new Font(new FontFamily(“宋体“) 100f);
            tbFont.Text = font.ToString();
            tbFont.Tag = font;
        }

        private void MainForm_Load(object sender EventArgs e)
        {
            graphics = this.CreateGraphics();
        }

        private void MainForm_Paint(object sender PaintEventArgs e)
        {
            DrawingContext context = new DrawingContext(e.Graphics);
            using (Pen p = new Pen(Color.Red lineWidth))
            {
                context.Pen = p;
                //画图
                foreach (WordOutlineDrawing outline in wordOutlines)
                {
                    outline.Draw(context);
                }
            }
        }

        private void MainForm_MouseMove(object sender MouseEventArgs e)
        {
            this.Text = string.Format(“({0}{1})“ e.X e.Y);
        }

        private void tvList_AfterSelect(object sender TreeViewEventArgs e)
        {
            DrawingContext context = new DrawingContext(graphics);
            using (Pen pen = new Pen(Color.Blue lineWidth))
            {
                context.Pen = pen;

                if (e.Node.Nodes.Count > 0)
                {//存在子项
                    pen.Color = Color.Green;

                    Cursor.Current = Cursors.WaitCursor;
                    foreach (TreeNode node in e.Node.Nodes)
                    {
                        IDrawing drawing = node.Tag as IDrawing;
                        if (drawing != null)
                        {
                            drawing.Draw(context);
                        }
                        Thread.Sleep(250);
                    }
                    Cursor.Current = Cursors.Default;
                }
                else
                {
                    IDrawing drawing = e.Node.Tag as IDrawing;
                    if (drawing != null)
                    {
                        drawing.Draw(context);
                    }
                }
            }
        }

        #region FillWordOutlines

        /// 
        /// 填充所有字符轮廓
        /// 

        private void FillWordOutlines()
        {
            //清空
            wordOutlines.Clear();
            tvList.Nodes.Clear();
            //填充
      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件          0  2019-05-15 14:48  字形轮廓提取显示C#源码(0515)\111.accdb

     文件       9216  2019-05-15 14:50  字形轮廓提取显示C#源码(0515)\222222.doc

     文件       9366  2008-10-16 13:20  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\App.ico

     文件       9366  2008-10-16 13:20  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\App.ico

     文件        391  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\BeelineDrawing.cs

     文件        385  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\CurvelineDrawing.cs

     文件       1125  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\DrawingContext.cs

     文件        376  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\IDrawing.cs

     文件        544  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\IDrawingContext.cs

     文件        667  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\LineDrawing.cs

     文件        813  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\PolygonDrawing.cs

     文件        384  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\PolylineDrawing.cs

     文件       1117  2008-10-16 11:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Drawing\WordOutlineDrawing.cs

     文件       9218  2008-10-16 13:37  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\MainForm.cs

     文件      13718  2008-10-16 13:37  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\MainForm.Designer.cs

     文件      20363  2008-10-16 13:37  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\MainForm.resx

     文件        904  2008-10-16 11:16  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Outline\ConvertUtil.cs

     文件        727  2008-10-16 11:16  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Outline\Data\DLine.cs

     文件        996  2008-10-16 13:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Outline\Data\DOutline.cs

     文件        955  2008-10-16 13:17  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Outline\Data\DPolygon.cs

     文件        666  2008-10-16 11:16  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Outline\GdiNativeMethods.cs

     文件       2946  2008-10-16 11:16  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Outline\StructDefine.cs

     文件       5517  2008-10-16 11:16  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Outline\WordGraph.cs

     文件        474  2008-10-16 11:19  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Program.cs

     文件       1175  2008-10-16 13:24  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Properties\AssemblyInfo.cs

     文件       2880  2008-10-16 11:19  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Properties\Resources.Designer.cs

     文件       5612  2008-10-16 11:19  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Properties\Resources.resx

     文件       1097  2008-10-16 11:19  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Properties\Settings.Designer.cs

     文件        249  2008-10-16 11:19  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\Properties\Settings.settings

     文件       4193  2008-10-16 13:21  字形轮廓提取显示C#源码(0515)\字形轮廓提取显示C#源码\Backup\TrueTypeText.csproj

............此处省略65个文件信息

评论

共有 条评论