canvas

Canvas flashlight effect

两盒软妹~` 提交于 2019-12-29 09:32:29
问题 I found this code from another question on here, but it seems it never got fully answered. How can I make it so the canvas is always black, and the mouse generates a flashlight effect to see what is under the canvas, and then refills itself? Im trying to make this effect over the entire page, not an image. The answer given was for making this over an image, but I don't know how to make it over the entire page. The effect I mean is like this, except over an entire page: Here is the question I

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

匆匆过客 提交于 2019-12-29 09:08:05
问题 I have two flot charts in One page , and with the code below, I want to use jsPDF to create report of them in two different pages (but one PD file) here id my code: Lets use this sample graphs : function flot1() { var oilPrices = [[1167692400000, 61.05], [1167778800000, 58.32], [1167865200000, 57.35], [1167951600000, 56.31], [1168210800000, 55.55], [1168297200000, 55.64] , [1168383600000, 54.02], [1168470000000, 51.88], [1168556400000, 52.99], [1168815600000, 52.99], [1168902000000, 51.21],

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

£可爱£侵袭症+ 提交于 2019-12-29 09:08:02
问题 I have two flot charts in One page , and with the code below, I want to use jsPDF to create report of them in two different pages (but one PD file) here id my code: Lets use this sample graphs : function flot1() { var oilPrices = [[1167692400000, 61.05], [1167778800000, 58.32], [1167865200000, 57.35], [1167951600000, 56.31], [1168210800000, 55.55], [1168297200000, 55.64] , [1168383600000, 54.02], [1168470000000, 51.88], [1168556400000, 52.99], [1168815600000, 52.99], [1168902000000, 51.21],

jQuery and Canvas.toDataURL

非 Y 不嫁゛ 提交于 2019-12-29 09:07:33
问题 I'm working on a script, and a small part of that involves taking a canvas and converting it to a downloadable image. To do this, I do: var thumb_jpeg = thumbnail.toDataURL("image/jpeg"); $("#" + options.dest).attr('src',thumb_jpeg); ...where thumbnail is a canvas tag and options.dest is the name of an img id. This code works perfectly in Chrome, but when I try it in Firefox, Firebug throws up this error: Security error" code: "1000 var thumb_jpeg = thumbnail.toDataURL("image/jpeg"); I would

Display two object same real distance (e.g. inches) apart across different browers / screen sizes

扶醉桌前 提交于 2019-12-29 08:26:22
问题 I'm developing a psychology experiment in the browser. In order to keep the same viewing angle across people, I want to display two characters around 5 inches apart on the screen. Is there any way to detect the real size of the monitor being used, and using the screen resolution and DPI, render the two objects the same real width apart? (I will only allow people that have real computers, e.g. not mobile) I heard detecting real size may not be possible, if true, and assuming people will report

drawing a circle where the user has touched on canvas

ぐ巨炮叔叔 提交于 2019-12-29 08:16:24
问题 Starting to learn Canvas and have two classes so far (main one to call the view and the view) The View class onDraw creates a target (ie number of cicles and each one coloured differently) I have a ontouch listenerer set up to record the x and y where the user clicks my trouble then is drawing a new circle / point where the user touches UPDATED with classes Main Class public class StartScreen extends Activity { DrawView drawView; @Override public void onCreate(Bundle savedInstanceState) {

drawing a circle where the user has touched on canvas

孤人 提交于 2019-12-29 08:16:05
问题 Starting to learn Canvas and have two classes so far (main one to call the view and the view) The View class onDraw creates a target (ie number of cicles and each one coloured differently) I have a ontouch listenerer set up to record the x and y where the user clicks my trouble then is drawing a new circle / point where the user touches UPDATED with classes Main Class public class StartScreen extends Activity { DrawView drawView; @Override public void onCreate(Bundle savedInstanceState) {

Embedding Matplotlib live plot data from Arduino in tkinter canvas

a 夏天 提交于 2019-12-29 08:02:42
问题 I've only been using Python for a couple of weeks. I have no problems plotting the data coming in from the Arduino with Matplotlib. However the plot shows up as a pop-window and I would like that plot to only show up in a canvas in the root window of the GUI I'm making with tkinter. I've tried multiple combinations of things and I can't get it to work. If I just add the plot values to the code, let's say: a.plot([1, 2, 3, 4, 5], [2, 3, 4, 5, 6, 7]) it works fine, so my main problem then is

Embedding Matplotlib live plot data from Arduino in tkinter canvas

╄→гoц情女王★ 提交于 2019-12-29 08:01:59
问题 I've only been using Python for a couple of weeks. I have no problems plotting the data coming in from the Arduino with Matplotlib. However the plot shows up as a pop-window and I would like that plot to only show up in a canvas in the root window of the GUI I'm making with tkinter. I've tried multiple combinations of things and I can't get it to work. If I just add the plot values to the code, let's say: a.plot([1, 2, 3, 4, 5], [2, 3, 4, 5, 6, 7]) it works fine, so my main problem then is

html2canvas error: Uncaught Error: IndexSizeError: DOM Exception 1

只愿长相守 提交于 2019-12-29 07:35:12
问题 I am using html2canvas to convert a div on a canvas. Like this: <script src="js/libs/jquery-1.7.1.min.js"></script> <script src="js/libs/jquery-ui-1.8.17.custom.min.js"></script> <script src="js/html2canvas/html2canvas.js"></script> ... <body id="body"> <div id="demo"> ... </div> </body> <script> $('#demo').html2canvas({ onrendered: function( canvas ) { var img = canvas.toDataURL() window.open(img); } }); </script> and I get this error: "Uncaught Error: IndexSizeError: DOM Exception 1" in