private void K_ValueChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { if (kInput.Value.HasValue) { this.K = kInput.Value.Value; algorithm?.Apply(K, K, K); } }
private void AverageDitheringRadio_Checked(object sender, RoutedEventArgs e) { SetBitmapImage(); this.algorithm = new AverageDitheringAlgorithm(algorithmBitmap); algorithm.Apply(Kr, Kg, Kb); OpenNewWindow(); }
private void PopularityAlgorithmRadio_Checked(object sender, RoutedEventArgs e) { SetBitmapImage(); this.algorithm = new PopularityAlgorithm(algorithmBitmap); algorithm.Apply(K, K, K); OpenNewWindow(); SetColorInputsVisibility(Visibility.Hidden); }
static void Main(string[] args) { // General Initialize(); /************************* * Leemos el fichero * *************************/ FileStream fs = new FileStream(inputPath, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs, Encoding.ASCII); // Leemos la línea 1 LoadInformationFromLine1(sr); // Leemos la línea 2 LoadBookScoreFromLine2(sr); // Leemos el resto de líneas con librerías LoadLibrariesFromOtherLines(sr); /************************* * Aplicamos el algoritmo * *************************/ Output output = Algorithm.Apply(_input); /************************* * Guardamos la salida * *************************/ SaveFileWithOutput(output); // Para evitar cerrar la consola Console.ReadLine(); }