I'm working on an image editor with the Html Canvas and JavaScript (just to learn even more about both languages). I've searched around but none of the questions I've found have worked. Here is what I have right now:
<input type="text" id="PicName">
<input type="button" value="Save" id="Save" onclick="Save()">
<canvas style="border:1px solid blue;" id="myCanvas" width="800" height="800"></canvas>
<script>
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
var timer = setInterval(gameLoop,10);
function gameLoop()
{
var PicName = document.getElementById("PicName").value;
ctx.fillStyle = "black";
ctx.font = "30px Calbri";
ctx.fillText(PicName,300,395);
}
</script>
PicName is the field were the person can input the name of the file. As you can see (if you give it a try) I've already gotten the PicName selector to work. So now I just need to save the file WITH the name.
if you give it a try- how do you propose we give it a try? there's at least two elements missingdownload.setAttribute("download", document.getElementById("PicName").value + '.png');perhaps