I've been struggling to resolve this issue, which seems simple, but I'm not getting it,
Maybe I'm not knowing how to ask the question , so I count on goodwill from friends:
1. I have the following canvas:
->
var placeholder = document.querySelector('.flot-base');
var context = placeholder.getContext('2d');
Just like another 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 canvas "ctx"
function copy{
var imgData = context.getImageData(684, 0, 784, 250);
ctx.putImageData(imgData, 100, 0);
}
= >
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?