예제 #1
0
        private List <int> redactImageAndFrames(Bitmap img, List <int> redactionTypes, List <int> frames)
        {
            for (int i = 0; i < redactionTypes.Count; i++)
            {
                switch (redactionTypes[i])
                {
                case 0:    //без эффектов
                    changes.Clear();
                    BTN_Cancel.Enabled = false;
                    update();
                    break;

                case 1:    //Размытие
                    ImageController.blur(img);
                    break;

                case 2:    //Осветление
                    ImageController.lighten(img);
                    break;

                case 3:    //Затемнение
                    ImageController.darken(img);
                    break;

                case 4:    //оттенки серого
                    ImageController.gray(img);
                    break;

                case 5:    //Блики
                    ImageController.glare(img);
                    break;

                case 6:    //Поворот на 90
                    ImageController.rotate_90(img);
                    frames = rotateFrame_90(frames);
                    break;

                case 7:    //Растяжение
                    ImageController.stretch(img);
                    break;

                case 8:    //Сдвиг
                    ImageController.shift(img);
                    break;

                default:
                    break;
                }
            }
            return(frames);
        }
예제 #2
0
 private void drawFrames(bool show)
 {
     if (show)
     {
         Rectangle[] rects = new Rectangle[4];
         int         j     = 0;
         for (int i = 0; i < rects.Length; i++)
         {
             int with   = currentFrames[j + 2] - currentFrames[j];
             int height = currentFrames[j + 3] - currentFrames[j + 1];
             rects[i] = new Rectangle(currentFrames[j], currentFrames[j + 1], with, height);
             j       += 4;
         }
         ImageController.drawFrames(currentRedactedImage, rects);
     }
 }