private void button1_Click(object sender, EventArgs e) { int seed = Convert.ToInt32(initialseed.Text); int tap = Convert.ToInt32(tapText.Text); string path = textBox2.Text; huffman h = new huffman(ImageMatrix); Dictionary <byte, string> red = h.getRedCode(); Dictionary <byte, string> blue = h.getBlueCode(); Dictionary <byte, string> green = h.getGreenCode(); h.writeHeader(path, ref ImageMatrix, seed, tap); ImageOperations.saveinbinaryfile(red, green, blue, ImageMatrix, path); }
private void btnGaussSmooth_Click(object sender, EventArgs e) { string initialsed = initialseed.Text; int pos = int.Parse(tapText.Text); int[] seed = new int[initialsed.Length]; for (int i = 0; i < initialsed.Length; i++) { seed[i] = (int)initialsed[i] - 48; } ImageMatrix = ImageOperations.incrept(ImageMatrix, ref seed, pos); huffman h = new huffman(ImageMatrix); Dictionary <byte, string> red = h.getRedCode(); Dictionary <byte, string> blue = h.getBlueCode(); Dictionary <byte, string> green = h.getGreenCode(); ImageOperations.DisplayImage(ImageMatrix, pictureBox2); }