CommonTools/ColorPickerCtrl/ColorTable.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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

namespace CommonTools
{
	public class ColorTable : LabelRotate
	{
		public event EventHandler SelectedIndexChanged;
		public Color SelectedItem
		{
			get
			{
				if (m_selindex < 0 || m_selindex >= m_colors.Count)
					return Color.White;
				return m_colors[m_selindex];
			}
			set 
			{
				if (m_selindex < m_colors.Count && value == m_colors[m_selindex])
					return;
				int index = m_colors.IndexOf(value);
				if (index < 0)
					return;
				SetIndex(index);
			}
		}
		public bool ColorExist(Color c)
		{
			int index = m_colors.IndexOf(c);
			return index >= 0;
		}
		int m_cols = 0;
		int m_rows = 0;
		public int Cols
		{
			get { return m_cols; }
			set
			{
				m_cols = value;
				m_rows = m_colors.Count / m_cols; 
				if ((m_colors.Count % m_cols) != 0)
					m_rows++;
			}
		}	
		Size m_fieldSize = new Size(12, 12);
		public Size FieldSize
		{
			get { return m_fieldSize; }
			set { m_fieldSize = value; }
		}
		int CompareColorByValue(Color c1, Color c2)
		{
			int color1 = c1.R << 16 | c1.G << 8 | c1.B;
后面还有 289 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。