canvas

Saving images from HTML5 canvas directly

天涯浪子 提交于 2019-12-24 15:18:17
问题 I went through the demo jsfiddle provided on the highcharts website at http://jsfiddle.net/highcharts/PDnmQ/. When i click the button as save as png, it downloads a file titled as download and not a png file. HTML: <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> <script src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script> <script src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script>

Fabric js : fabric js drawing mode and selection mode options

好久不见. 提交于 2019-12-24 15:08:41
问题 I'm using fabric js to develop a application to draw a line, Rectangle and circle in one canvas.And there is a other function to drag and drop a image on to canvas. But when i added drag and drop function to the application other three function are not working. I have found this article. But i was unable to integrate it with my one. function initCanvas() { $('.canvas-container').each(function (index) { var canvasContainer = $(this)[0]; var canvasObject = $("canvas", this)[0]; var url = $(this

Flipping algorithms?

谁说我不能喝 提交于 2019-12-24 15:04:07
问题 I am new in android canvas. I was created custom shape on " L Shaped Rectangle, Rectangle and some shapes " and using android canvas. It was working fine. In my question is Flipping custom Shape? previously i was used scale canvas.scale(-1.0f, 1.0f); it's working. after flip, that shape do some action such as( rotate, resize). But i didn't get any points. So i searched flip algorithm for basic. i didn't get it. If you know pls share your comments. 回答1: Matrix is your friend. The truth is that

How to change Image inside canvas's Canvas.Left property in WPF?

家住魔仙堡 提交于 2019-12-24 15:00:57
问题 simple question for you fellas. I have an image inside a Canvas, with a Canvas.Left property i want to change programaticly. How do i do that? 回答1: Call Canvas.SetLeft(theImage, newValue); This is the standard means of using Attached Properties from Code. When implementing an attached property (such as Canvas.Left), it's standard to include a static method that is named SetPropertyName for a given attached property named PropertyName . 来源: https://stackoverflow.com/questions/9282796/how-to

HTML5 Canvas - Grouping / Attaching an image TO a canvas

独自空忆成欢 提交于 2019-12-24 14:46:14
问题 I have a problem I am hoping someone is able to help with. Using this JSFIDDLE I am able to press a button to add new canvases to the screen... var next = 4 function addCanvas() { // create a new canvas element var newCanvas = document.createElement("canvas"); newCanvas.id = "addedcanvases" + next; //added this to give each new canvas a unique id next++; newCanvas.width = canvasWidth; newCanvas.height = canvasHeight; // add a context for the new canvas to the contexts[] array contexts.push

Click on line in canvas

浪子不回头ぞ 提交于 2019-12-24 14:33:05
问题 Is it possible get info, if is click on line in canvas? var canvas; var x = 200; var y = 200; var dx=4; var dy=4; var d = 5; var width, height; function init() { canvasE = document.getElementById('game'); canvas= canvasE.getContext('2d'); width = canvasE.width; height = canvasE.height; canvasE.addEventListener("click", onClick, false); drawCircle(); } function drawCircle() { clear(); canvas.arc(x-1,y-1,d,0,Math.PI*2,true); canvas.beginPath(); canvas.arc(x-1,y-1,d,0,Math.PI*2,true); canvas

Write (0,0) in center of the canvas-HTML5

老子叫甜甜 提交于 2019-12-24 14:31:50
问题 I'm currently developing a drawing app which allows the user to click and drag to determine the size of the shape and also be able to make transformations with the shape drawn. This is the screenshot of what i have till now: I positioned the axis in the center of the canvas but now i want to write (0,0) in the center. As you can see, the CSS i wrote only makes it appear at the top but i want it at the center. Here's my codes for the transformation.html: <!DOCTYPE html> <head> <title>Drawing

HTML5 pointermove/touchmove not working in Microsoft Edge

删除回忆录丶 提交于 2019-12-24 14:14:22
问题 I'm working on something which is more or less a drawing app. I need to support Microsoft Edge and there's the problem. As soon as you want to catch the touchmove or pointermove event, Edge tries to scroll (even if it's not possible). Here's an example. Just try to draw something there (touch/pen), mouse works perfectly even in Edge. In every other browser (except maybe IE) it works very well. I have no idea why IE is ignoring the preventDefault() function. Has someone an idea? Sample: https:

Connect off canvas menu with markers

泄露秘密 提交于 2019-12-24 13:54:57
问题 I'm working on a mapping project and I need to mark some building to display some data for that specific building. Basically, literally I'm trying to build something like this I have found off canvas project and I'm using it for mine map, here is a working JSFIDDLE example. For the map I'm using openlayers3 , openstreetmap , I'm not using google-maps and I'm not interesting in using it, I'm just referencing on this picture because they have a nice example of this off canvas display data menu.

Create valley text (text with curve) in Fabric.js

断了今生、忘了曾经 提交于 2019-12-24 13:29:42
问题 I am using Fabric.js to display text on CANVAS.. which works great and displays text like below What I am trying to achieve is Text effect like below below Instead of plain.. is it possible to do so? Here is my code.. <!DOCTYPE html> <head> <meta charset="utf-8"> <title>fabric.js-simple text display</title> <!-- Get version 1.1.0 of Fabric.js from CDN --> <script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.1.0/fabric.all.min.js" ></script> <!-- Get the highest 1.X version of