/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 private void makePhotoSeriesButton_Click(object sender, RoutedEventArgs e)
 {
     BackgroundImagesGeneratorForm newForm = new BackgroundImagesGeneratorForm();
     newForm.oneImageOfSeries += oneImageOfSeriesTaken;
     newForm.Show();
 }
        // bit b/w
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public static Bitmap drawBitImage(double N_sin, double f1, int width, int height, int XY, int MASK, BackgroundImagesGeneratorForm.BitImageType type)
        {
            int i, j;
            byte r;
            double nx = width + 1;
            double pi = Math.PI;
            double af = pi * 2 * N_sin / nx;
            Bitmap result = new Bitmap(width, height);
            BitmapData bitmapData = ImageProcessor.getBitmapData(result);

            for (i = 0; i < width; i++)
            {
                for (j = 0; j < height; j++)
                {
                    if (XY == 0)
                    {
                        r = (byte)((Math.Sin(af * i + pi * f1 / 180) + 1) * 127);
                    }
                    else
                    {
                        r = (byte)((Math.Sin(af * j + pi * f1 / 180) + 1) * 127);
                    }

                    if (r > 255)
                    {
                        r = 0;
                    }

                    r = BITMASK(r, MASK);

                    ImageProcessor.setPixel(bitmapData, i, j, Color.FromArgb(r, r, r));
                }
            }

            result.UnlockBits(bitmapData);
            return result;
        }