• 大小: 901KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: C#
  • 标签: C#  截图  捕获  QQ  抓屏  

资源简介

效果图和说明 看博客 http://blog.csdn.net/crystal_lz/article/details/9200859

资源截图

代码片段和文件信息

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

namespace _SCREEN_CAPTURE
{
    [Designer(typeof(ColorBoxDesginer))]
    public partial class ColorBox : Control
    {
        public ColorBox() {
            InitializeComponent();
            selectedColor = Color.Red;
            m_rectSelected = new Rectangle(-100 -100 14 14);

            this.Setstyle(Controlstyles.ResizeRedraw true);
            this.Setstyle(Controlstyles.OptimizedDoubleBuffer true);
            this.Setstyle(Controlstyles.AllPaintingInWmPaint true);
            this.Setstyle(Controlstyles.UserPaint true);
            this.Setstyle(Controlstyles.SupportsTransparentBackColor true);
        }

        private Color selectedColor;
        public Color SelectedColor {
            get { return selectedColor; }
        }

        private Point m_ptCurrent;
        private Rectangle m_rectSelected;
        private Bitmap m_clrImage = global::_SCREEN_CAPTURE.Properties.Resources.color;
        private Color m_lastColor;

        public delegate void ColorChangedHandler(object sender ColorChangedEventArgs e);
        public event ColorChangedHandler ColorChanged;
        protected virtual void OnColorChanged(ColorChangedEventArgs e) {
            if (this.ColorChanged != null)
                ColorChanged(this e);
        }

        protected override void onclick(EventArgs e) {
            Color clr = m_clrImage.GetPixel(m_ptCurrent.X m_ptCurrent.Y);
            if (clr.ToArgb() != Color.FromArgb(255 254 254 254).ToArgb()
                && clr.ToArgb() != Color.FromArgb(255 133 141 151).ToArgb()
                && clr.ToArgb() != Color.FromArgb(255 110 126 149).ToArgb()) {
                if (this.selectedColor != clr)
                    this.selectedColor = clr;
                this.Invalidate();
                this.OnColorChanged(new ColorChangedEventArgs(clr));
            }
            base.onclick(e);
        }

        protected override void onmousemove(MouseEventArgs e) {
            m_ptCurrent = e.Location;
            try {
                Color clr = m_clrImage.GetPixel(m_ptCurrent.X m_ptCurrent.Y);
                if (clr != m_lastColor) {
                    if (clr.ToArgb() != Color.FromArgb(255 254 254 254).ToArgb()
                        && clr.ToArgb() != Color.FromArgb(255 133 141 151).ToArgb()
                        && clr.ToArgb() != Color.FromArgb(255 110 126 149).ToArgb()
                        && e.X > 39) {
                        m_rectSelected.Y = e.Y > 17 ? 17 : 2;
                        m_rectSelected.X = ((e.X - 39) / 15) * 15 + 38;
                        this.Invalidate();
                    } else {
                        m_rectSelected.X = m_rectSelected.Y = -100;
                        this.Invalidate();
                    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-12-11 03:31  _SCREEN_CAPTURE_TOOL\
     目录           0  2013-01-23 23:55  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\
     目录           0  2012-12-11 03:31  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\bin\
     目录           0  2013-01-12 04:54  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\bin\Debug\
     文件      265728  2013-06-29 04:47  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\bin\Debug\_SCREEN_CAPTURE.dll
     文件      138752  2013-06-29 04:47  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\bin\Debug\_SCREEN_CAPTURE.pdb
     目录           0  2013-01-12 03:13  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\bin\Release\
     文件      262144  2013-06-29 04:40  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\bin\Release\_SCREEN_CAPTURE.dll
     文件      126464  2013-06-29 04:40  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\bin\Release\_SCREEN_CAPTURE.pdb
     文件        4309  2012-12-08 23:20  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\ColorBox.cs
     文件        1202  2012-12-03 22:32  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\ColorBox.Designer.cs
     文件        5817  2012-12-03 03:09  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\ColorBox.resx
     文件         390  2012-12-03 02:17  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\ColorBoxDesginer.cs
     文件       27011  2013-01-29 01:09  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmCapture.cs
     文件       17211  2013-01-11 03:31  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmCapture.Designer.cs
     文件        6184  2013-01-11 03:31  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmCapture.resx
     文件       13796  2013-03-09 01:26  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmOut.cs
     文件        7659  2013-01-24 00:02  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmOut.Designer.cs
     文件      212946  2013-01-24 00:02  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmOut.resx
     文件        2219  2013-06-29 04:40  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmSize.cs
     文件        3873  2013-01-24 00:03  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmSize.Designer.cs
     文件        5817  2013-01-24 00:03  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\FrmSize.resx
     文件       29821  2013-01-23 23:45  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\ImageProcessBox.cs
     文件        1043  2012-11-28 21:50  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\ImageProcessBox.Designer.cs
     文件        4402  2013-01-23 20:59  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\MouseHook.cs
     目录           0  2012-12-11 03:31  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\obj\
     目录           0  2013-06-29 04:47  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\obj\Debug\
     文件        9054  2013-01-12 20:30  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7231  2013-06-29 04:47  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2013-01-11 03:13  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\obj\Debug\TempPE\
     文件        6144  2013-01-11 03:13  _SCREEN_CAPTURE_TOOL\_SCREEN_CAPTURE\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
............此处省略108个文件信息

评论

共有 条评论