private void opacitySlider_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e) { opacity = (float)opacitySlider.Value; MosaicEngine engine = new MosaicEngine(mosaicDirectory, baseImage); engine.ChangeOpacityOfMosaicFromFiles(opacity); finalMosaic.Source = ImageLoader("final mosaic.png"); dragStarted = false; }
private void opacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { if (!dragStarted) { opacity = (float)opacitySlider.Value; MosaicEngine engine = new MosaicEngine(mosaicDirectory, baseImage); engine.ChangeOpacityOfMosaicFromFiles(opacity); finalMosaic.Source = ImageLoader("final mosaic.png"); } }
private void bw_DoWork(object sender, DoWorkEventArgs e) { try { while (!bw.CancellationPending) { MosaicEngine engine = new MosaicEngine(mosaicDirectory, baseImage); engine.CreateMosaicWithBaseImageOverlay(opacity, bw); } } catch (Exception) { MessageBox.Show("Please enter a valid path."); bw.CancelAsync(); } }