示例#1
0
        // *******************************************************
        private void CreateColors(int r, int c)
        {
            m_Rows = r;
            if (m_Rows < 1)
            {
                m_Rows = 1;
            }
            m_Cols = c;
            if (m_Cols < 1)
            {
                m_Cols = 1;
            }
            int idx = 0;

            for (int j = 0; j < r; j++)
            {
                for (int i = 0; i < c; i++)
                {
                    ColorBox cb = new ColorBox();
                    cb.Name        = String.Format("Colorbox{0}", idx);
                    cb.SelectColor = Color.Gray;
                    cb.AE_Color    = AEColor.FromArgb(10, 10, 10);;
                    cb.Index       = idx;
                    cb.MouseDown  += Cb_MouseDown;
                    Items.Add(cb);
                    idx++;
                }
            }
        }
示例#2
0
        // ****************************************************************************************
        public void ColorToClip(AEColor col)
        {
            string str =
                "Adobe After Effects 8.0 Keyframe Data\r\n"
                + "\r\n"
                + "	Units Per Second	24\r\n"
                + "	Source Width	1440\r\n"
                + "	Source Height	810\r\n"
                + "	Source Pixel Aspect Ratio	1\r\n"
                + "	Comp Pixel Aspect Ratio	1\r\n"
                + "\r\n"
                + "Effects	カラー制御 #2	カラー #2\r\n"
                + "	Frame	alpha 	red 	green 	blue 	\r\n"
                + "		$A	$R	$G	$B	\r\n"
                + "\r\n"
                + "\r\n"
                + "End of Keyframe Data\r\n";


            str = str.Replace("$A", col.A.ToString());
            str = str.Replace("$R", col.R.ToString());
            str = str.Replace("$G", col.G.ToString());
            str = str.Replace("$B", col.B.ToString());

            Clipboard.SetText(str);
        }
示例#3
0
        private void InitColors(int r, int c)
        {
            if ((m_Cols == c) && (m_Rows == r))
            {
                return;
            }
            int cnt = r * c;

            if (Count > cnt)
            {
                int st = Count - 1;
                for (int i = st; i >= cnt; i--)
                {
                    Items[i].Dispose();
                    Items.RemoveAt(i);
                }
            }
            else
            {
                int st = Count;
                for (int i = st; i < cnt; i++)
                {
                    ColorBox cb = new ColorBox();
                    cb.Name        = String.Format("Colorbox{0}", i);
                    cb.SelectColor = Color.Gray;
                    cb.AE_Color    = AEColor.FromArgb(10, 10, 10);;
                    cb.Index       = i;
                    cb.MouseDown  += Cb_MouseDown;
                    Items.Add(cb);
                }
            }
        }
示例#4
0
        // **********************************************************************
        static public AEColor FromArgb(double r, double g, double b)
        {
            AEColor ret = new AEColor();

            ret.m_A = 255.0;
            ret.m_R = r;
            ret.m_G = g;
            ret.m_B = b;
            return(ret);
        }
示例#5
0
        // ****************************************************************************************
        public AEColor[] ColorFromClip()
        {
            AEColor[] ret = new AEColor[0];

            string[] sa = GetClip();
            if (sa.Length < 8)
            {
                return(ret.ToArray());
            }
            ret = AnalysisColors(sa);
            return(ret);
        }
示例#6
0
        // **************************************************************************
        public void SetColor(double r, double g, double b)
        {
            if ((m_Color.R == r) && (m_Color.G == g) && (m_Color.B == b))
            {
                return;
            }

            if (m_IsLocked == false)
            {
                m_Color = AEColor.FromArgb(r, g, b);
            }
            this.Invalidate();
        }
示例#7
0
        // **************************************************************************
        public void SetColor(AEColor c)
        {
            double r, g, b;

            r = c.R; g = c.G; b = c.B;

            if (m_Color.Equals(c) == true)
            {
                return;
            }
            if (m_IsLocked == false)
            {
                m_Color = c;
            }
            this.Invalidate();
        }
示例#8
0
 // **********************************************************************
 public bool Equals(AEColor c)
 {
     return((m_A == c.m_A) && (m_R == c.m_R) && (m_G == c.m_G) && (m_B == c.m_B));
 }