Example #1
0
 private void OnebyOne()
 {
     byte[] answ = new byte[1];
     textBox4.Clear();
     textBox3.Clear();
     for (int i = 0; i < image.Height; i = i + 2)
     {
         bool stop = false;
         for (int j = 0; j < image.Width; j = j + 2)
         {
             char a;
             RGB = image.GetPixel(j, i);
             answ[answ.Length - 1] = WordBulder.RGBinSTR(RGB, out a);
             Array.Resize(ref answ, answ.Length + 1);
             if (a == '#')
             {
                 stop = true;
                 break;
             }
         }
         if (stop)
         {
             break;
         }
     }
     foreach (byte i in answ)
     {
         textBox4.Text += i.ToString() + " ";
     }
     textBox3.Text = Encoding.GetEncoding(1251).GetString(answ);
 }
Example #2
0
        private void Diagonal()
        {
            byte[] answ = new byte[1];
            textBox4.Clear();
            textBox3.Clear();
            try
            {
                for (int i = 0; i < image.Width; i++)
                {
                    char a;
                    RGB = image.GetPixel(i, i);
                    answ[answ.Length - 1] = WordBulder.RGBinSTR(RGB, out a);
                    Array.Resize(ref answ, answ.Length + 1);
                    if (a == '#')
                    {
                        break;
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error open file, choise bmp file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            foreach (byte i in answ)
            {
                textBox4.Text += i.ToString() + " ";
            }
            textBox3.Text = Encoding.GetEncoding(1251).GetString(answ);
        }