public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            ColorEx color = (ColorEx)value;

            using (ColorDialog colorDialog = new ColorDialog())
            {
                colorDialog.AllowFullOpen = true;
                colorDialog.AnyColor      = true;
                colorDialog.FullOpen      = true;
                colorDialog.ShowHelp      = true;
                colorDialog.Color         = ColorExToColor(color);
                int colorabgr = (int)color.ToABGR();
                colorabgr &= 0x00ffffff;
                int[] colorsabgr = new int[1];
                colorsabgr[0]            = colorabgr;
                colorDialog.CustomColors = colorsabgr;
                DialogResult result = colorDialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    color = ColorToColorEx(colorDialog.Color);
                }
                colorDialog.Color = ColorExToColor(color);
            }
            return(color);
        }
Ejemplo n.º 2
0
        private void diffuseSelectButton_Click(object sender, EventArgs e)
        {
            ColorDialog colorDialog1;

            using (colorDialog1 = new ColorDialog())
            {
                colorDialog1.SolidColorOnly = false;
                colorDialog1.AllowFullOpen  = true;
                colorDialog1.AnyColor       = true;
                int colorabgr = (int)diffuse.ToABGR();
                colorabgr &= 0x00ffffff;
                int[] colorsabgr = new int[1];
                colorsabgr[0]             = colorabgr;
                colorDialog1.FullOpen     = true;
                colorDialog1.ShowHelp     = true;
                colorDialog1.Color        = ColorExToColor(diffuse);
                colorDialog1.CustomColors = colorsabgr;
                DialogResult result = colorDialog1.ShowDialog();
                if (result == DialogResult.OK)
                {
                    diffuseSelectButton.BackColor = colorDialog1.Color;
                    diffuse = ColorToColorEx(colorDialog1.Color);
                }
            }
        }
Ejemplo n.º 3
0
        public static int ConvertColorValue(ColorEx color, VertexElementType colorVertexElementType)
        {
            switch (colorVertexElementType)
            {
#if AXIOM_PLATFORM == AXIOM_PLATFORM_WIN32
            default:
#endif
            case VertexElementType.Color_ARGB:
                return(color.ToARGB());

#if AXIOM_PLATFORM != OGRE_PLATFORM_WIN32
            default:
#endif
            case VertexElementType.Color_ABGR:
                return(color.ToABGR());
            }
        }
Ejemplo n.º 4
0
        public AddPlantTypeDialog(string title, List <AssetDesc> list, WorldEditor app)
        {
            InitializeComponent();
            ColorEx color = new ColorEx();

            color = app.Config.PlantColorDefault;
            colorDialog1.Color          = ColorExToColor(color);
            colorSelectButton.BackColor = colorDialog1.Color;
            int colorabgr = (int)color.ToABGR();

            int[] colorsabgr = new int[1];
            colorabgr                &= 0x00ffffff;
            colorsabgr[0]             = colorabgr;
            colorDialog1.CustomColors = colorsabgr;

            foreach (AssetDesc asset in list)
            {
                imageNameComboBox.Items.Add(asset.Name);
            }
            imageNameComboBox.SelectedIndex = 0;
        }