3
I’ve been struggling to resolve this issue, which seems simple, but I’m not getting it,
Maybe I am not knowing how to ask the question, then I count on the goodwill of friends:
1. I have the following canvas:
->
var placeholder = document.querySelector('.flot-base');
var context = placeholder.getContext('2d');
Just like other test canvas
var c = document.getElementById('analysisFullGraph1');
var ctx = c.getContext('2d');
With this function I can easily copy a part of the canvas "placehoder" to the canvas "ctx"
function copy{
var imgData = context.getImageData(684, 0, 784, 250);
ctx.putImageData(imgData, 100, 0);
}
=>
- however I am trying to copy from the canvas to another image, but did not succeed...
for example:
<html>
<img id='analysisFullGraph1' src="full_graphics.png" />
</html>
<script>
var placeholder = document.querySelector('.flot-base');
var context = placeholder.getContext('2d');
var imageCTX = document.getElementById('analysisFullGraph1');
function copy{
var imgData = context.getImageData(684, 0, 784, 250);
imageCTX.putImageData(imgData, 100, 0);
}
</script>
How to make this copy?
Please avoid long discussions in the comments; your talk was moved to the chat
– bfavaretto