private void qualitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     BitmapUtilities.setEncoderQuality((int)qualitySlider.Value);
 }