Example #1
0
        public void ResizeBackground(int width, int height)
        {
            double aspect = (double)width / (double)_background.Width;
            //Console.WriteLine("Resizing background to: " + width + ", " + height);
            Bitmap newBackground = PreviewTools.ResizeBitmap(new Bitmap(_background), new Size(width, height));
            // Copy the file to the Vixen folder
            string imageFileName = Guid.NewGuid().ToString() + ".jpg";
            var    destFileName  = System.IO.Path.Combine(VixenPreviewDescriptor.ModulePath, imageFileName);

            newBackground.Save(destFileName, ImageFormat.Jpeg);
            Data.BackgroundFileName = destFileName;
            LoadBackground(destFileName);

            foreach (Shapes.DisplayItem item in DisplayItems)
            {
                item.Shape.Resize(aspect);
            }
        }