From 6b7e7678f9561177d790c17079e0d6d754f2e471 Mon Sep 17 00:00:00 2001 From: "omar.lopez" Date: Wed, 28 Feb 2024 14:15:37 +0000 Subject: [PATCH] Actualizar ImageToAscii/src/imagetoascii/ImageToAscii.java --- ImageToAscii/src/imagetoascii/ImageToAscii.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ImageToAscii/src/imagetoascii/ImageToAscii.java b/ImageToAscii/src/imagetoascii/ImageToAscii.java index 24f5046..a5f37d6 100644 --- a/ImageToAscii/src/imagetoascii/ImageToAscii.java +++ b/ImageToAscii/src/imagetoascii/ImageToAscii.java @@ -1,4 +1,3 @@ - package imagetoascii; import java.awt.BorderLayout; import java.awt.Color; @@ -95,7 +94,7 @@ public class ImageToAscii extends JFrame { JButton button = new JButton(text); button.setBackground(color); button.setForeground(Color.WHITE); - button.addActionListener(e -> handleButtonClick(text)); // Reemplaza handleButtonClick con el manejo apropiado + button.addActionListener(e -> handleButtonClick(text)); return button; } @@ -245,7 +244,7 @@ public class ImageToAscii extends JFrame { } private static char getAsciiChar(int gray) { - // Ajusta estos valores segĂșn tu preferencia + char[] asciiChars = {'@', '#', '8', '&', 'o', ':', '*', '.', ' '}; int index = gray * (asciiChars.length - 1) / 255; return asciiChars[index];