Upload and Display
How do I make an upload and display?
What is a upload and display? How do you make a upload and display? This script and codes were developed by Lichi Chen on 18 October 2022, Tuesday.
Upload and Display - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Upload and Display</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="https://www.dukelearntoprogram.com/course1/common/js/image/SimpleImage.js" ></script>
<h1>The Web Page</h1>
<canvas id = "can">
</canvas>
<canvas id = "two">
</canvas>
<p> Filename: <input type = "text" id = "tinput"> <input type = "text" value = "upload" onclick = "upload()">
<input type = "file" multiple = "false" accept = "image/*" id = "finput" onchange = "upload1()">
<input type = "button" value = "makeGrayScale" onclick = "makeGray()">
</p> <script src="js/index.js"></script>
</body>
</html>
Upload and Display - Script Codes CSS Codes
h1 { color: darkblue;
}
canvas { width: 500px; margin: 20px; border: 5px solid lightgray;
}
finput { font-size: 14px;
}
Upload and Display - Script Codes JS Codes
function upload() { var txtinput = document.getElementById("tinput"); var txt = txtinput.value; alert("You chose" + txt);
}
var image;
var img;
function upload1() { var c = document.getElementById("can"); var imageinput = document.getElementById("finput"); image = new SimpleImage(imageinput); image.drawTo(c);
}
function makeGray() { for (var pixel of image.values()) { var avg = (pixel.getRed() + pixel.getGreen() + pixel.getBlue())/3; pixel.setRed(avg); pixel.setGreen(avg); pixel.setBlue(avg); } var t = document.getElementById("two"); image.drawTo(t);
}
Developer | Lichi Chen |
Username | chenlichiclc |
Uploaded | October 18, 2022 |
Rating | 3 |
Size | 2,022 Kb |
Views | 18,216 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
3 | 1,905 Kb |
Color chooser practice-1 | 1,730 Kb |
Color chooser practice-2 | 1,887 Kb |
1 | 1,885 Kb |
Draft | 2,161 Kb |
The Filter Page | 3,026 Kb |
My Interests Page | 2,331 Kb |
The Filter Page-3 | 2,033 Kb |
Week 3 | 2,287 Kb |
2 | 1,975 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Cars going | Netoguimaraes | 1,699 Kb |
Sign Up Form | Sicontis | 5,272 Kb |
Snow collision | Wojtek1150 | 3,542 Kb |
Awesome textarea | Ayoungh | 1,977 Kb |
Sketchy Box | Mnicpt | 3,033 Kb |
Css Rotating 3d cubes different speed | Dghez | 2,364 Kb |
Transitioning application screens with semantically named classes | Djgrant | 3,697 Kb |
Mostly Fluid | Mccreath | 3,308 Kb |
Mandelbrot Fractal | _Billy_Brown | 2,706 Kb |
Super Discount | Orrinward | 3,225 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!