资源简介

非常不错的一个联机绘图程序,局域网内进行联机绘图,源码设计的非常好,实现了分层。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.IO;
using System.Drawing.Printing;

namespace MultiDraw
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            this.SuspendLayout();
            CC.palette = new Palette();
            CC.palette.Dock = Dockstyle.Fill;
            this.Controls.Add(CC.palette);
            this.ResumeLayout();
            SetUserState();

            CC.myService.mainForm = this;
            if (CC.userState == UserState.Server || CC.userState== UserState.SingleUser)
            {
                CC.palette.Deserializeobject(CC.backupFileName);
            }
            else
            {
                CC.me.SendToServer(“Login“);
            }
        }

        public void SetUserState()
        {
            if (CC.userState == UserState.SingleUser)
            {
                this.toolStripLabelUserState.Text = “制作方式:单机制作“;
            }
            else if (CC.userState == UserState.Server)
            {
                this.toolStripLabelUserState.Text = string.Format(“制作方式:多机联合制作,本机为主机({0}),与本机连接用户数:{1}“ CC.me.LocalIPString CC.myServer.Users.Count - 1);
            }
            else if (CC.userState == UserState.Client)
            {
                this.toolStripLabelUserState.Text = string.Format(“制作方式:多机联合制作,本机为附机({0}), 主机:{1}“ CC.me.LocalIPString CC.me.client.Client.RemoteEndPoint);
            }
        }

        private void buttonRectangle_Click(object sender EventArgs e)
        {
            CC.palette.ActiveTool = Palette.ToolType.Rectangle;
        }

        private void buttonText_Click(object sender EventArgs e)
        {
            TextDialog td = new TextDialog();
            if (td.ShowDialog() == DialogResult.OK)
            {
                CC.textInfo.text = td.MyText;
                CC.textInfo.color = td.MyColor;
                CC.palette.ActiveTool = Palette.ToolType.Text;
            }
        }

        private void buttonCurve_Click(object sender EventArgs e)
        {
            CC.palette.ActiveTool = Palette.ToolType.Curve;
        }

        private void buttonGraphics_Click(object sender EventArgs e)
        {
            OpenFileDialog f = new OpenFileDialog();
            f.Multiselect = false;
            f.CheckPathExists = true;
            f.title = “添加图像“;
            f.Filter = “JPEG (*.jpg)|*.jpg|Bitmap (*.bmp)|*.bmp|PNG (*.png)|*.png|GIF (*.gif)|*.gif|All files|*.*“;
            if (f.ShowDialog() == DialogResult.OK)
            {
                CC.bitmap = (Bitmap)Bitmap.FromFile(f.FileNametrue);
                CC.palette.ActiveTool = Palette.ToolType.Image;
            }
        }

        private void Ma

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

     文件     519060  2011-06-05 08:25  MultiDraw\MultiDraw\bin\Debug\backup.gcs

     文件      62464  2011-06-05 08:24  MultiDraw\MultiDraw\bin\Debug\MultiDraw.exe

     文件     204288  2011-06-05 08:24  MultiDraw\MultiDraw\bin\Debug\MultiDraw.pdb

     文件      11608  2011-06-05 08:25  MultiDraw\MultiDraw\bin\Debug\MultiDraw.vshost.exe

     文件      44272  2009-05-04 16:39  MultiDraw\MultiDraw\bin\Debug\myDraw.jpg

     文件       6584  2010-02-24 00:09  MultiDraw\MultiDraw\ClassDiagram1.cd

     文件       2858  2009-03-25 10:11  MultiDraw\MultiDraw\cs\CC.cs

     文件       2059  2009-07-20 21:19  MultiDraw\MultiDraw\cs\DrawMyCurve.cs

     文件       1974  2009-03-21 17:26  MultiDraw\MultiDraw\cs\DrawMyImage.cs

     文件        710  2008-04-02 15:11  MultiDraw\MultiDraw\cs\DrawMyRectangle.cs

     文件       1644  2009-03-31 22:27  MultiDraw\MultiDraw\cs\DrawMyText.cs

     文件       3627  2009-07-20 21:22  MultiDraw\MultiDraw\cs\Drawobject.cs

     文件       5961  2009-04-01 16:23  MultiDraw\MultiDraw\cs\GraphicsList.cs

     文件       9281  2009-08-13 14:24  MultiDraw\MultiDraw\cs\MyClient.cs

     文件       8739  2009-08-13 14:25  MultiDraw\MultiDraw\cs\MyServer.cs

     文件       7886  2009-04-01 18:21  MultiDraw\MultiDraw\cs\MyService.cs

     文件       1858  2009-03-25 10:11  MultiDraw\MultiDraw\cs\objectID.cs

     文件       3006  2008-04-06 15:36  MultiDraw\MultiDraw\cs\ToolCurve.cs

     文件       1966  2008-04-06 15:36  MultiDraw\MultiDraw\cs\ToolImage.cs

     文件       1493  2009-03-25 23:01  MultiDraw\MultiDraw\cs\Toolobject.cs

     文件       7877  2009-03-25 23:01  MultiDraw\MultiDraw\cs\ToolPointer.cs

     文件       1387  2008-04-06 15:36  MultiDraw\MultiDraw\cs\ToolRectangle.cs

     文件       1868  2008-04-06 15:36  MultiDraw\MultiDraw\cs\ToolText.cs

     文件       6756  2008-04-01 16:22  MultiDraw\MultiDraw\cs\TrackCurve.cs

     文件       7524  2009-03-29 10:35  MultiDraw\MultiDraw\cs\TrackRectangle.cs

     文件       8229  2008-09-03 16:47  MultiDraw\MultiDraw\cs\TrackText.cs

     文件       1474  2008-04-01 14:35  MultiDraw\MultiDraw\cs\User.cs

     文件       6301  2009-04-01 10:58  MultiDraw\MultiDraw\csForm\Palette.cs

     文件       1782  2009-04-01 10:58  MultiDraw\MultiDraw\csForm\Palette.Designer.cs

     文件       5814  2009-04-01 10:58  MultiDraw\MultiDraw\csForm\Palette.resx

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

评论

共有 条评论