Пример #1
0
        // Changement de la palette
        private void ClickColor(object sender, MouseEventArgs e)
        {
            Label colorClick = sender as Label;
            int   pen        = colorClick.Tag != null ? (int)colorClick.Tag : 0;

            if (e.Button == MouseButtons.Right)
            {
                int       col    = BitmapCpc.paletteSprite[pen];
                RvbColor  colRvb = new RvbColor((byte)((col & 0x0F) * 17), (byte)(((col & 0xF00) >> 8) * 17), (byte)(((col & 0xF0) >> 4) * 17));
                EditColor ed     = new EditColor(main, pen, col, colRvb.GetColor, true);
                ed.ShowDialog(this);
                if (ed.isValide)
                {
                    BitmapCpc.paletteSprite[pen] = ed.ValColor;
                    col = ed.ValColor;
                    colors[pen].BackColor = Color.FromArgb((byte)((col & 0x0F) * 17), (byte)(((col & 0xF00) >> 8) * 17), (byte)(((col & 0xF0) >> 4) * 17));
                    colors[pen].Refresh();
                    DrawMatrice();
                }
            }
            else
            {
                penLeft = (byte)pen;
                DrawPens();
            }
        }
Пример #2
0
        // Changement de la palette
        private void ClickColor(object sender, MouseEventArgs e)
        {
            Label colorClick = sender as Label;
            int   pen        = colorClick.Tag != null ? (int)colorClick.Tag : 0;

            if (!modeEdition.Checked)
            {
                EditColor ed = new EditColor(main, pen, BitmapCpc.Palette[pen], bitmapCpc.GetColorPal(pen).GetColorArgb, BitmapCpc.cpcPlus);
                ed.ShowDialog(this);
                if (ed.isValide)
                {
                    BitmapCpc.Palette[pen]  = ed.ValColor;
                    lockColors[pen].Checked = true;
                    lockState[pen]          = 1;
                    UpdatePalette();
                    Convert(false);
                }
            }
            else
            {
                if (editToolMode != EditTool.Draw)
                {
                    rbDraw.Checked = true;
                }

                RvbColor col = bitmapCpc.GetColorPal(pen);
                if (e.Button == System.Windows.Forms.MouseButtons.Left)
                {
                    drawCol             = pen;
                    drawColor.BackColor = Color.FromArgb(col.r, col.v, col.b);
                }
                else
                {
                    undrawCol             = pen;
                    undrawColor.BackColor = Color.FromArgb(col.r, col.v, col.b);
                }
            }
        }