rmrss11 0 Posted May 23, 2019 Report Share Posted May 23, 2019 (edited) Olá. Tenho de fazer um efeito, como que um efeito numa imagem que é multiplicar a mesma em 4. public static ColorImage multiple(ColorImage img) { ColorImage reduced = new ColorImage(img.getWidth() / 2, img.getHeight() / 2); for (int i = 0; i != img.getWidth(); i++) { for (int j = 0; j != img.getHeight(); j++) { Color c0 = img.getColor(2*i,j*2); for( int c=0;c!= reduced.getWidth();c++){ for(int l=0;l!=reduced.getWidth();l++){ reduced.setColor(c, l, c0); Color c1 = reduced.getColor(i,j); for (int x = 0; x != img.getWidth(); x++) { for (int y = 0; y != img.getHeight(); y++) { img.setColor(x, y, c1); img.setColor(x + img.getWidth() / 2, y, c1); img.setColor(x, y + img.getHeight() / 2,c1); img.setColor(x + img.getWidth() / 2, x + img.getHeight() / 2,c1); } } } } } } return img; } } O problema é que isso me dá um erro logo quando é para criar a cor da imagem reduzida, e não consigo perceber qual é o erro. Será que alguém me consegue ajudar? Fico desde já agradecido. Com os melhores cumprimentos, rmrss11 Edited May 23, 2019 by nunopicado Syntax Highlight Link to post Share on other sites
M6 149 Posted May 27, 2019 Report Share Posted May 27, 2019 Ajudava se mostrasses o erro. Se não percebes o erro, imagina o pessoal que nem sabe qual é o erro... 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now