• 大小: 0.15M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: C#
  • 标签: 其他  

资源简介

YU_字形轮廓提取显示C#源码.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();
          

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

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

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

     文件        399  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\BeelineDrawing.cs

     文件        397  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\CurvelineDrawing.cs

     文件       1201  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\DrawingContext.cs

     文件        412  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\IDrawing.cs

     文件        596  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\IDrawingContext.cs

     文件        695  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\LineDrawing.cs

     文件        850  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\PolygonDrawing.cs

     文件        396  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\PolylineDrawing.cs

     文件       1182  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Drawing\WordOutlineDrawing.cs

     文件       9736  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\MainForm.cs

     文件      13720  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\MainForm.Designer.cs

     文件      20367  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\MainForm.resx

     文件        932  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Outline\ConvertUtil.cs

     文件        771  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Outline\Data\DLine.cs

     文件       1050  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Outline\Data\DOutline.cs

     文件       1016  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Outline\Data\DPolygon.cs

     文件        678  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Outline\GdiNativeMethods.cs

     文件       3188  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Outline\StructDefine.cs

     文件       6258  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Outline\WordGraph.cs

     文件        476  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Program.cs

     文件       1177  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Properties\AssemblyInfo.cs

     文件       2882  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Properties\Resources.Designer.cs

     文件       5614  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Properties\Resources.resx

     文件       1099  2019-10-17 10:14  YU_字形轮廓提取显示C#源码\Backup\Properties\Settings.Designer.cs

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

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

     文件        168  2008-10-16 11:20  YU_字形轮廓提取显示C#源码\Backup\TrueTypeText.csproj.user

     文件        912  2008-10-16 11:19  YU_字形轮廓提取显示C#源码\Backup\TrueTypeText.sln

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

评论

共有 条评论