资源简介

本程序实现了计算机图形学中基本图形:直线、圆、以及椭圆的绘制。其中直线可采用DDA画线算法与Bresenham画线算法两种方法绘制;圆采用了中点圆画线算法绘制;椭圆采用了中点椭圆画线算法绘制。此外还实现了对图形的平移、旋转和缩放三种基本操作。其中缩放操作提供了普通模式与智能模式,使用后者可以消除普通模式缩放时产生的像素稀疏以及锯齿化现象。同时新版本对操作界面进行了改进和优化。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;

namespace drawitem
{
    partial class AboutBox1 : Form
    {
        public AboutBox1()
        {
            InitializeComponent();
            this.Text = String.Format(“关于 {0} “ Assemblytitle);
            this.labelProductName.Text += AssemblyProduct;
            this.labelVersion.Text = String.Format(“版本  {0} “ AssemblyVersion);
            this.labelCopyright.Text += AssemblyCopyright;
            this.labelCompanyName.Text += AssemblyCompany;
            this.textBoxDescription.Text = “    “ + AssemblyDescription;
        }

        #region 程序集属性访问器

        public string Assemblytitle
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblytitleAttribute) false);
                if (attributes.Length > 0)
                {
                    AssemblytitleAttribute titleAttribute = (AssemblytitleAttribute)attributes[0];
                    if (titleAttribute.title != ““)
                    {
                        return titleAttribute.title;
                    }
                }
                return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Codebase);
            }
        }

        public string AssemblyVersion
        {
            get
            {
                return Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
        }

        public string AssemblyDescription
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute) false);
                if (attributes.Length == 0)
                {
                    return ““;
                }
                return ((AssemblyDescriptionAttribute)attributes[0]).Description;
            }
        }

        public string AssemblyProduct
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute) false);
                if (attributes.Length == 0)
                {
                    return ““;
                }
                return ((AssemblyProductAttribute)attributes[0]).Product;
            }
        }

        public string AssemblyCopyright
        {
            get
            {
                object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute) false);
                if (attributes.Length == 0)
                {
                    return ““;
                }
                return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
            }
        }

        public string AssemblyCom

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

     文件        930  2010-09-24 21:04  drawitem\drawitem.sln

    ..A..H.     67584  2010-10-18 22:09  drawitem\drawitem.suo

     文件       3455  2010-10-16 19:21  drawitem\WindowsFormsApplication3\AboutBox1.cs

     文件      10457  2010-10-15 06:38  drawitem\WindowsFormsApplication3\AboutBox1.Designer.cs

     文件      49723  2010-10-15 06:38  drawitem\WindowsFormsApplication3\AboutBox1.resx

     文件      90112  2010-10-18 22:09  drawitem\WindowsFormsApplication3\bin\Debug\drawitem.exe

     文件     134656  2010-10-18 22:09  drawitem\WindowsFormsApplication3\bin\Debug\drawitem.pdb

     文件      14328  2010-10-18 22:08  drawitem\WindowsFormsApplication3\bin\Debug\drawitem.vshost.exe

     文件        490  2007-07-21 01:33  drawitem\WindowsFormsApplication3\bin\Debug\drawitem.vshost.exe.manifest

     文件        490  2007-07-21 01:33  drawitem\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.manifest

     文件       1334  2010-10-17 22:24  drawitem\WindowsFormsApplication3\buttonimages\about.bmp

     文件       1334  2010-10-17 22:31  drawitem\WindowsFormsApplication3\buttonimages\circle.bmp

     文件       1334  2010-10-17 22:12  drawitem\WindowsFormsApplication3\buttonimages\clear.bmp

     文件       1334  2010-10-17 22:35  drawitem\WindowsFormsApplication3\buttonimages\ellipse.bmp

     文件       1334  2010-10-17 21:44  drawitem\WindowsFormsApplication3\buttonimages\line.bmp

     文件       1334  2010-10-17 21:56  drawitem\WindowsFormsApplication3\buttonimages\move.bmp

    ..A.SH.     10752  2012-01-05 10:42  drawitem\WindowsFormsApplication3\buttonimages\Thumbs.db

     文件       1334  2010-10-17 22:05  drawitem\WindowsFormsApplication3\buttonimages\turn.bmp

     文件       1334  2010-10-17 22:07  drawitem\WindowsFormsApplication3\buttonimages\zoom.bmp

     文件       2356  2010-09-29 06:26  drawitem\WindowsFormsApplication3\ClassDiagram\InputClassDiagram.cd

     文件       1772  2010-09-29 06:29  drawitem\WindowsFormsApplication3\ClassDiagram\ItemClassDiagram.cd

     文件       9561  2010-10-18 22:09  drawitem\WindowsFormsApplication3\drawitem.csproj

     文件        533  2010-10-18 22:09  drawitem\WindowsFormsApplication3\drawitem.csproj.user

     文件       1215  2010-10-17 12:12  drawitem\WindowsFormsApplication3\input\Circleinput.cs

     文件       5822  2010-10-17 12:12  drawitem\WindowsFormsApplication3\input\Circleinput.Designer.cs

     文件       7233  2010-10-17 12:12  drawitem\WindowsFormsApplication3\input\Circleinput.resx

     文件        507  2010-10-17 12:01  drawitem\WindowsFormsApplication3\input\Drawinput.cs

     文件       4369  2010-10-17 12:01  drawitem\WindowsFormsApplication3\input\Drawinput.Designer.cs

     文件       6713  2010-10-17 12:01  drawitem\WindowsFormsApplication3\input\Drawinput.resx

     文件       1340  2010-10-17 12:15  drawitem\WindowsFormsApplication3\input\Ellipseinput.cs

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

评论

共有 条评论