// CONSTRUCTOR public BatchSettings(object sender) { InitializeComponent(); // Stops manual editing of the combo box, meaning that somehting HAS to be arrIsProcessed comboBatchFileExportType.DropDownStyle = ComboBoxStyle.DropDownList; this.FormBorderStyle = FormBorderStyle.FixedDialog; // Tracks the currenty in-use filter curFilterIndex = 0; UpdateCheckedStatus(); mainProgram = (PicViewer)sender; // Reference to main form arrIsProcessed = new bool[mainProgram.listLoadedImg.Count()]; // array of bool matching length of list // Populate checklist of images batchFileSelectionList.Items.Clear(); for (int i = 0; i < arrIsProcessed.Length; i++) { // Add an item using the listLoadedImage collection's item names, prechecked batchFileSelectionList.Items.Add(mainProgram.listLoadedImg[i].GetName(), true); } // Suite of image adjustment tools ImgAdjust adjustImg = new ImgAdjust(); // Used to create a LoadedImage object Bitmap imgForPreview; //// If check allows for development work without having to load an images every time //if (mainProgram.listLoadedImg.Count() == 0) //{ // imgForPreview = adjustImg.GetArgbVer(Bitmap.FromFile("..//..//testImage.jpg")); //} //else //{ // imgForPreview = mainProgram.listLoadedImg[0].GetBitmap("c"); //} imgForPreview = mainProgram.listLoadedImg[0].GetBitmap("c"); // LoadedImage class object is created, it's previewVer is displayed in the thumbnail previewLoadedImage = mainProgram.listLoadedImg[0]; picBatchPreview.Image = previewLoadedImage.GetBitmap("p"); comboBatchFileExportType.SelectedIndex = 0; // Creates a call to UpdateOptions(); }
private void button3_Click(object sender, EventArgs e) { ImgAdjust adj = new ImgAdjust(); picBatchPreview.Image = adj.GetScaledVer((Bitmap)picBatchPreview.Image, (float)txtBatchScale.Value, (float)txtBatchScale.Value, false); }