Exemplo n.º 1
0
        public static void exportAsImage()
        {
            Bitmap image = new Bitmap(Data.imageLocation);

            int boxWidth  = image.Width / 5;
            int boxHeight = image.Height / 8;
            int margin    = boxHeight / 9;
            int center    = (image.Width / 2) - (boxWidth / 2);
            int template  = margin;

            for (int i = 0; i < 7; i++)
            {
                using (Graphics graphics = Graphics.FromImage(image))
                {
                    using (SolidBrush brush = new SolidBrush(Alchemy.hextoColor(Data.colors[i])))
                    {
                        graphics.FillRectangle(brush, center, template, boxWidth, boxHeight);

                        template += margin + boxHeight;
                    }
                }
            }
            image.Save("Exported Palette.bmp");
            System.Windows.Forms.MessageBox.Show("Image has been exported!");
        }
Exemplo n.º 2
0
        private void outputWindow_Load(object sender, EventArgs e)
        {
            pictureBox.ImageLocation = Data.imageLocation;

            panel1.BackColor = Alchemy.hextoColor(Data.colors[0]);
            label1.Text      = Data.colors[0];
            panel2.BackColor = Alchemy.hextoColor(Data.colors[1]);
            label2.Text      = Data.colors[1];
            panel3.BackColor = Alchemy.hextoColor(Data.colors[2]);
            label3.Text      = Data.colors[2];
            panel4.BackColor = Alchemy.hextoColor(Data.colors[3]);
            label4.Text      = Data.colors[3];
            panel5.BackColor = Alchemy.hextoColor(Data.colors[4]);
            label5.Text      = Data.colors[4];
            panel6.BackColor = Alchemy.hextoColor(Data.colors[5]);
            label6.Text      = Data.colors[5];
            panel7.BackColor = Alchemy.hextoColor(Data.colors[6]);
            label7.Text      = Data.colors[6];
        }