• 大小: 469KB
    文件类型: .rar
    金币: 2
    下载: 2 次
    发布日期: 2022-09-21
  • 语言: C#
  • 标签: C#  截图控件  

资源简介

C# 实现完整功能的截图控件,便于vs调用第三方控件

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

namespace CSharpWin
{
    /* 作者:Starts_2000
     * 日期:2009-09-08
     * 网站:http://www.csharpwin.com CS 程序员之窗。
     * 你可以免费使用或修改以下代码,但请保留版权信息。
     * 具体请查看 CS程序员之窗开源协议(http://www.csharpwin.com/csol.html)。
     */
    public partial class CaptureImageTool : Form
    {
        #region Fields

        private Image _image;
        private CaptureImageToolColorTable _colorTable;
        private Cursor _selectCursor = Cursors.Default;
        private Cursor _drawCursor = Cursors.Cross;

        private Point _mouseDownPoint;
        private Point _endPoint;
        private bool _mouseDown;
        private Rectangle _selectImageRect;
        private Rectangle _selectImageBounds;
        private bool _selectedImage;
        private SizeGrip _sizeGrip;
        private Dictionary _sizeGripRectList;
        private OperateManager _operateManager;
        private List _linePointList;

        private static readonly Font TextFont =
           new Font(“Times New Roman“ 12F Fontstyle.Bold GraphicsUnit.Point 0);
        private static readonly string ToolTipStartCapture = “按住左键不放选择截图区域“;

        #endregion

        #region Constructors

        public CaptureImageTool()
        {
            InitializeComponent();
            Init();
        }

        #endregion

        #region Properties

        [Browsable(false)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public CaptureImageToolColorTable ColorTable
        {
            get
            {
                if (_colorTable == null)
                {
                    _colorTable = new CaptureImageToolColorTable();
                }
                return _colorTable;
            }
            set
            {
                _colorTable = value;
                base.Invalidate();
                SetControlColorTable();
            }
        }

        private void SetControlColorTable()
        {
            CaptureImageToolColorTable colorTable = ColorTable;
            ToolStripRendererEx renderer = new ToolStripRendererEx(colorTable);
            contextMenuStrip.Renderer = renderer;
            drawToolsControl.ColorTable = colorTable;
            colorSelector.ColorTable = colorTable;
        }

        public Image Image
        {
            get { return _image; }
        }

        public Cursor SelectCursor
        {
            get { return _selectCursor; }
            set { _selectCursor = value; }
        }

        public Cursor DrawCursor
        {
            get { return _drawCursor; }
            set { _drawCursor = value; }
        }

        internal bool SelectedImage
        {
    

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

     文件      81920  2009-09-14 09:49  CaptureImageToolDemo\CaptureImageTool\bin\Debug\CaptureImageTool.dll

     文件     144896  2009-09-14 09:49  CaptureImageToolDemo\CaptureImageTool\bin\Debug\CaptureImageTool.pdb

     文件      43642  2009-09-14 09:49  CaptureImageToolDemo\CaptureImageTool\CaptureImageTool.cs

     文件       5482  2009-09-10 10:52  CaptureImageToolDemo\CaptureImageTool\CaptureImageTool.csproj

     文件       7857  2009-09-12 10:33  CaptureImageToolDemo\CaptureImageTool\CaptureImageTool.Designer.cs

     文件       6417  2009-09-12 10:33  CaptureImageToolDemo\CaptureImageTool\CaptureImageTool.resx

     文件       1533  2009-09-10 10:07  CaptureImageToolDemo\CaptureImageTool\CaptureImageToolColorTable.cs

     文件       2436  2009-09-10 10:07  CaptureImageToolDemo\CaptureImageTool\ColorLabel.cs

     文件      17220  2009-09-10 10:08  CaptureImageToolDemo\CaptureImageTool\ColorSelector.cs

     文件      13615  2009-09-08 11:35  CaptureImageToolDemo\CaptureImageTool\ColorSelector.Designer.cs

     文件       5814  2009-09-08 11:35  CaptureImageToolDemo\CaptureImageTool\ColorSelector.resx

     文件      10068  2009-09-10 10:08  CaptureImageToolDemo\CaptureImageTool\ControlPaintEx.cs

     文件        553  2009-09-10 10:08  CaptureImageToolDemo\CaptureImageTool\Drawstyle.cs

     文件       1354  2009-09-10 10:10  CaptureImageToolDemo\CaptureImageTool\DrawTextData.cs

     文件      12326  2009-09-10 10:10  CaptureImageToolDemo\CaptureImageTool\DrawToolsControl.cs

     文件      10177  2009-09-06 13:43  CaptureImageToolDemo\CaptureImageTool\DrawToolsControl.designer.cs

     文件       6011  2009-09-06 13:43  CaptureImageToolDemo\CaptureImageTool\DrawToolsControl.resx

     文件        528  2009-09-10 10:10  CaptureImageToolDemo\CaptureImageTool\DrawToolsDockstyle.cs

     文件       4925  2009-09-05 10:09  CaptureImageToolDemo\CaptureImageTool\GraphicsPathHelper.cs

     文件       1406  2008-06-01 18:47  CaptureImageToolDemo\CaptureImageTool\Icons\Accept.ico

     文件       1406  2008-06-01 18:47  CaptureImageToolDemo\CaptureImageTool\Icons\Arrow.ico

     文件       1406  2008-06-01 18:47  CaptureImageToolDemo\CaptureImageTool\Icons\Ellipse.ico

     文件       1406  2008-06-01 18:47  CaptureImageToolDemo\CaptureImageTool\Icons\Exit.ico

     文件      10134  2008-06-04 21:21  CaptureImageToolDemo\CaptureImageTool\Icons\Line.ico

     文件       1406  2008-06-01 18:47  CaptureImageToolDemo\CaptureImageTool\Icons\Rectangular.ico

     文件        587  2009-09-03 23:28  CaptureImageToolDemo\CaptureImageTool\Icons\Redo.png

     文件       1406  2008-06-01 18:47  CaptureImageToolDemo\CaptureImageTool\Icons\Save.ico

     文件       1406  2008-06-01 18:47  CaptureImageToolDemo\CaptureImageTool\Icons\Text.ico

    ..A.SH.     12288  2009-09-09 08:50  CaptureImageToolDemo\CaptureImageTool\Icons\Thumbs.db

     文件       4078  2009-09-10 10:10  CaptureImageToolDemo\CaptureImageTool\NativeMethods.cs

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

评论

共有 条评论