AD

c#颜色拾取器程序

相信很多人用PS和做网页的时候,都会遇到一个取色的问题,现在奉上一个简单的颜色拾取器程序,因为这些是从以前的笔记里面翻出来的,就不加注释了,直接上代码,希望大家debug成功后,好好读一下代码,如果能优化或其它想法,欢迎大家留言交流
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Drawing.Imaging; using System.Runtime.InteropServices; 
namespace LiBo.ColorPicker { /// <summary> /// Form1 的摘要说明。 /// </summary> public class Form1 : System.Windows.Forms.Form { // 桌面工作区的尺寸 Size workingArea; // Form 的初始位置和在左下角,右下角的位置 Point formLoc, ptLeftBottom, ptRightBottom; 
private System.Windows.Forms.Label lblColor; private System.Windows.Forms.TextBox txtArgb; private System.Windows.Forms.Timer tmr; private System.Windows.Forms.ToolTip tip; private System.ComponentModel.IContainer components; 
public Form1() { InitializeComponent(); 
this.FormBorderStyle = FormBorderStyle.FixedToolWindow; this.StartPosition = FormStartPosition.CenterScreen; 
Rectangle rect = SystemInformation.WorkingArea; workingArea = new Size(rect.Width, rect.Height); ptLeftBottom = new Point(0, workingArea.Height - this.Height); ptRightBottom = new Point(workingArea.Width - this.Width, workingArea.Height - this.Height); 
String tipMsg = "在窗体空白处双击鼠标左键开始取色,按ESC键确定颜色

评论

此博客中的热门博文

简单粗暴导出小米便签

我——终于一个人了

Ubiquiti_Networks_UniFi_Cloud_Key_authed_rce