Server IP : 103.6.199.200 / Your IP : 18.191.212.146 Web Server : Microsoft-IIS/10.0 System : Windows NT EMPUSA 10.0 build 20348 (Windows Server 2016) i586 User : EMPUSA$ ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Domains/tradepan/eup.trade-panel.com/wwwroot/ |
Upload File : |
<%@ page language="C#" autoeventwireup="true" inherits="Snap, App_Web_w2d0cuxh" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <link rel="stylesheet" href="member/styles.css"> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.2.min.js" type="text/javascript"></script> <script type="text/Javascript" language="Javascript"> function drawShapes() { var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); context.fillStyle = "Blue"; context.fillRect(0, 0, 200, 200); context.beginPath(); context.lineWidth = "4"; context.strokeStyle = "Green"; context.fillStyle = "Yellow"; context.arc(150, 100, 50, 20, Math.PI * 2, false); context.font = "30px Arial"; context.strokeText("3", 20, 40); context.strokeText("4", 40, 40); context.strokeText("5", 60, 40); context.strokeText("6", 80, 40); context.stroke(); context.fill(); } </script> </head> <body onload="drawShapes()"> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" /> <input type="button" id="btnSave" name="btnSave" value="Save the canvas to server" /> <script type="text/javascript"> // Send the canvas image to the server. $(function() { $("#btnSave").click(function() { var image = document.getElementById("myCanvas").toDataURL("image/png"); var canv = document.getElementById("TextBox1"); canv.Value = "45555"; var uploadServerSideScriptPath = "Snap.aspx"; var xhr = new XMLHttpRequest(); xhr.open("POST", uploadServerSideScriptPath, false); xhr.setRequestHeader('Content-Type', 'application/upload'); xhr.send(image); }); }); </script> <canvas id="myCanvas" width="200" height="200"></canvas> </div> <div class="container"> <div class="app"> <p>Using Opera Next or Chrome Canary, use this page to take your picture!</p> <!-- Ideally these elements aren't created until it's confirmed that the client supports video/camera, but for the sake of illustrating the elements involved, they are created with markup (not JavaScript) --> <video id="video" width="640" height="480" autoplay></video> <canvas id="canvas" ></canvas> <button id="snap12" class="sexyButton">Snap Photo</button> <p id="error-message"></p> <img id="snap" /> <script> // Put event listeners into place window.addEventListener("DOMContentLoaded", function () { // Grab elements, create settings, etc. var canvas = document.getElementById("canvas"), image = document.querySelector('#snap'), context = canvas.getContext("2d"), video = document.getElementById("video"), videoObj = { "video": true }, errBack = function (error) { console.log("Video capture error: ", error.code); }; navigator.getMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); if(!navigator.getMedia){ displayErrorMessage("Your browser doesn't have support for the navigator.getUserMedia interface."); } else{ // Request the camera. navigator.getMedia( { video: true }, // Success Callback function(stream){ // Create an object URL for the video stream and // set it as src of our HTLM video element. video.src = window.URL.createObjectURL(stream); // Play the video element to start the stream. video.play(); video.onplay = function() { showVideo(); }; }, // Error Callback function(err){ displayErrorMessage("There was an error with accessing the camera stream: " + err.name, err); } ); } // Put video listeners into place // if (navigator.getUserMedia) { // Standard // navigator.getUserMedia(videoObj, function (stream) { // video.src = stream; // video.play(); // }, errBack); // } else if (navigator.webkitGetUserMedia) { // WebKit-prefixed // navigator.webkitGetUserMedia(videoObj, function (stream) { // video.src = window.webkitURL.createObjectURL(stream); // video.play(); // }, errBack); // } function takeSnapshot(){ // Here we're using a trick that involves a hidden canvas element. var error_message = document.querySelector('#error-message'); error_message.innerText = "TR"; var hidden_canvas = document.querySelector('canvas'), context = hidden_canvas.getContext('2d'); var width = video.videoWidth, height = video.videoHeight; if (width && height) { // Setup a canvas with the same dimensions as the video. hidden_canvas.width = 100; hidden_canvas.height = 100; // Make a copy of the current frame in the video on the canvas. //context.drawImage(video, 0, 0, width, height); context.drawImage(video, 0, 0, 100, 100); // Turn the canvas image into a dataURL that can be used as a src for our photo. return hidden_canvas.toDataURL('image/png'); } } // Trigger photo take document.getElementById("snap12").addEventListener("click", function () { // var snap = takeSnapshot(); context.drawImage(video, 0, 0, 100, 100); // var error_message2 = document.getElementById("snap12"); // e.preventDefault(); // var snap = takeSnapshot(); //error_message2.innerText = snap ; // Show image. // var snap = // image.setAttribute('src', snap); //-- var image12 = document.getElementById("canvas").toDataURL("image/png"); var image1 = "data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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fA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="; var canv = document.getElementById("TextBox1"); canv.value = image12; // image.setAttribute('src', image1); // image1 = image1.replace('data:image/png;base64,', ''); // var image1 = snap.replace('data:image/png;base64,', ''); $.ajax({ type: 'POST', url: 'Snap.aspx/UploadImage', data: '{ "imageData" : "' + image1 + '" }', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function(msg) { alert('Image saved successfully !'); } }); var error_message4 = document.getElementById("snap12"); error_message4.innerText = "TRRR"; //-- }); }, false); // var error_message2 = document.getElementById("snap12"); // error_message2.innerText = "TRRR"; </script> </div> </div> </form> </body> </html>