Beispiel #1
0
            public ColorPanel(Point pt, ColorButton button)
            {
                colorButton = button;

                FormBorderStyle = FormBorderStyle.FixedDialog;
                MinimizeBox     = false;
                MaximizeBox     = false;
                ControlBox      = false;
                ShowInTaskbar   = false;
                TopMost         = true;

                SetStyle(ControlStyles.DoubleBuffer, true);
                SetStyle(ControlStyles.UserPaint, true);
                SetStyle(ControlStyles.AllPaintingInWmPaint, true);

                Width  = 156;
                Height = 100;

                if (colorButton.autoButton != "")
                {
                    Height += 23;
                }
                if (colorButton.moreButton != "")
                {
                    Height += 23;
                }

                CenterToScreen();
                Location = pt;

                Capture = true;
            }
Beispiel #2
0
        public static IRgbColor GetRGBColor(ColorButton btnColor)
        {
            IRgbColor pRGB = new RgbColorClass();

            pRGB.Red   = btnColor.Color.R;
            pRGB.Green = btnColor.Color.G;
            pRGB.Blue  = btnColor.Color.B;
            if (btnColor.Color == Color.Transparent)
            {
                pRGB.Transparency = 0;
            }
            else
            {
                pRGB.Transparency = 255;
            }

            pRGB.UseWindowsDithering = true;
            return(pRGB);
        }