Questions tagged [todataurl]

a HTMLCanvasElement method that returns the data URI value of a canvas element

HTMLCanvasElement.toDataURL() is a method that returns the value of a element as a string.

Parameters

HTMLCanvasElement.toDataURL() accepts to optional parameters:

  • type: specifies the image type to be returned
  • encoderOptions: specifies the quality of the image to be returned

Resources

Related Tags

208 questions
0
votes
2 answers

Unable to get AJAX's post values (plain Javascript)

I'm aware that this question was answered in this forum (Unable to get values in POST php web serivce), but both the question and the answer used jQuery and, in my case, I can't use it (no matter why)... So, I have a Javascript file that is intended…
Johanovski
  • 235
  • 1
  • 5
  • 15
0
votes
2 answers

KineticJS: How to make IE9 save canvas as image?

I'm using this snippet to save canvas as image : when I click the button snapshot, id="snap", a new tab in FF (or window, in chrome) is opened and the image is called. document.getElementById('snap').addEventListener('click', function () { …
Sahar Ch.
  • 489
  • 1
  • 8
  • 28
0
votes
1 answer

Cross-origin error in canvas html5 kineticJS using path file://

I want to create image from my canvas, I'm using kineticjs, but I get error: "Kinetic warning: Unable to get data URL. Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported." I suppose, that it's caused by…
karfi
  • 23
  • 5
0
votes
1 answer

KineticJS: How can I include custom canvas shapes in a toDataURL function

My problem started with the version 5 of KineticJS, before that it was not a problem. Native KineticJS shapes such as squares and circles can be saved to an image file using the stage.toDataURL function. But it doesn't work for non-Kinetic shapes…
pitwall
  • 1
  • 2
0
votes
1 answer

How to download canvas as image, that includes drawImage()

I can achieve to download canvas as png file, unless I use drawImage() function. I know that toDataURL() doesn't allow external images for security issues. But even I use local images hosted on the same server, it still doesn't work. None of the…
telvin
  • 3
  • 2
0
votes
1 answer

Is it possible generated from local file image from html5-canvas

My canvas has image which programly generated from local file or from images from internet. When I try to save it using toDataURl function I get secure error. How can I save result (without server, using only js ) and is it possible? I know about…
aknew
  • 1,101
  • 7
  • 23
0
votes
1 answer

CORS is enabled but toDataURL still throws a warning

As the title says, I've enabled CORS for all of the images, but I'm still getting errors when trying to throw them onto a canvas and then extract that canvas (Chrome and FF). I ran a little sniffer on one of the images to test it out, and it seems…
user1807782
  • 451
  • 1
  • 4
  • 17
0
votes
2 answers

Send Data to Server using Canvas

I drow some objects with canvas KineticJS, I tried canvas.toDataURL("image/png"); but i don't know how to get params values when i click on submit button I want send some params to server, thanks
0
votes
2 answers

How to return an image from own PHP page using other server url

How can I make a PHP page that will return image from other server specified by url in variable, like this: http://www.mypage.com/MyScript.php?src=http://www.otherpage.com/image.png And after going to that page an image should apear. It need to work…
Kyrtap
  • 158
  • 1
  • 1
  • 8
-1
votes
2 answers

Internet Explorer canvas.toDataURL SecurityError

I run the following code on Internet Explorer, it throws a SecurityError on the line var canvasDataUrl = canvas.toDataURL(); var canvas = document.createElement('canvas'); var canvasContext = canvas.getContext('2d'); var img = new Image; img.onload…
code đờ
  • 554
  • 1
  • 9
  • 19
-2
votes
1 answer

convert base64 string to usable URL

I have a string that was made using toDataURL() on my HTML canvas, creating an image. I'd like to be able to encode / decode that string so it can be used with window.open(string) string looks…
Grambam
  • 424
  • 1
  • 3
  • 17
-2
votes
1 answer

html2canvas - toDataURL does not work all the time

I am trying to "clone" a table to an image in html, the code works but not all the time, it only work at the 2nd or 3rd trigger of the button. The picture below shows that at the first click the image table is not displayed only a box is displayed.…
SCS
  • 1,162
  • 3
  • 17
  • 31
-2
votes
1 answer

Why 2 identical images have different dataUrls?

I have 2 images both generated via javascript canvas. I want to check if both images are identical. For this I generated a set of images and saved them as png files. I then tried to compare the dataUrls of both, the previously generated image and…
Fuzzyma
  • 7,619
  • 6
  • 28
  • 60
1 2 3
13
14