示例#1
0
        private void doWork_Click(object sender, EventArgs e)
        {
            string filePath = file.Text;
            Bitmap img      = Pixelator.pixelate(filePath);

            outputImage.Image = img;
        }
示例#2
0
        private void loadImg_Click(object sender, EventArgs e)
        {
            OpenFileDialog o = new OpenFileDialog();

            o.DefaultExt = "bmp";
            o.Filter     = "PNG Files|*.png";
            if (o.ShowDialog() == DialogResult.OK)
            {
                Bitmap img    = new Bitmap(o.FileName);
                byte[] output = Pixelator.depixelate(img);

                SaveFileDialog s = new SaveFileDialog();
                s.DefaultExt = "exe";
                s.Filter     = "Exe Files|*.exe";
                if (s.ShowDialog() == DialogResult.OK)
                {
                    System.IO.File.WriteAllBytes(s.FileName, output);
                }
            }
        }