canvas

HTML Canvas: draw image without anti-aliasing

I want to do pixel-true rendering of some images on my Canvas. Right now, I obtain the images through Javascript, so my images are HTMLImageElement instances. I can draw these on the Canvas' rendering context with drawImage. However, this performs anti-aliasing on the image, which I don't want. There appears to be a lower-level image m...

WPF - Creating simple controls to be used on a Canvas

I'm developing a simple WPF UI for image post-processing. I'd like to create a draggable WPF control to be used on a Canvas which would look roughly like this: Both end points ellipses would be draggable and the line joining them would follow as the end points move. Now, I know how to implement this by simply adding these elements i...

Silverlight Canvas children collection changed

Is there a way to Catch if the childrencollection of a canvas in Silverlight has changed? (when a child is added or removed) I know the ObservableCollection has such an event, how could i rase one for my Canvas? ...

best way to animate canvas shadowBlur with jQuery?

I'm very much a noob so please forgive me if there's a "duh" solution here. Is there a good, or at least a simple, way to animate things like shadowColor or shadowBlur with jQuery? E.g. If I have something like: function draw(){ var canvas = document.getElementById(elem); if (canvas.getContext){ var draw = canvas.getContext('2d'); ...

Centering my O3D canvas

I would like to have a centered O3D canvas. Can anyone suggest how I might do this? ...

Canvas Animation Kit Experiment... ...how to clear the canvas?

I can make a obj to use the canvas to draw like this: MyObj.myDiv = new Canvas($("effectDiv"), Setting.width, Setting.height); Then, I use this to draw a rectangle on the canvas: var c = new Rectangle(80, 80, { fill: [220, 40, 90] } ); var move = new Timeline; move.addKeyframe(0, { x: 0, y: 0 } ); c.addTimeli...

How to add a border on HTML5 Canvas' Text?

I can draw text using these code: myCanvas.fillStyle = "Red"; myCanvas.font = "30pt Arial"; myCanvas.fillText("Some Text", 10, 30); I want to add a border around "Some Text", any ideas on that? ...

How to make SVG work with IE?

Hi Guys, Does anybody know of a comprehensive library to make SVG work with IE (7 and 8 in particular)? I wanted something Javascript which could be included in my web page and which would silently convert all my SVG to VML in a fashion similar to what excanvas does for Canvas. ...

Move HTML Canvas by javascript

Hi! I'm trying to copy element from one in my page to another (via javascript). It's successfully copied but appeared empty. How to copy/move canvas with content? ...

possible to use html images like canvas with getImageData / putImageData ?

I'd like to know if there is a way to dynamically modify/access the data contained in html images just as if they were an html5 canvas element. With canvas, you can in javascript access the raw pixel data with getImageData() and putImageData(), but I have thus far been not able to figure out how to do this with images. ...

How to Make Canvas Text Selectable?

Any suggestion is highly appreciated. ...

Python canvas suggestions

I'm looking for a very simple canvas for python. What I really need is the ability to draw lines and circles, move them around / get rid of them, and scroll the canvas (so, I'm ideally drawing on an infinite canvas, and just scrolling it around). Ideally, the code would look like: c = Canvas() l1 = c.line((x0, y0), (x1, y1)) l2 = c.line...

Threaded drawing onto a canvas in Java SWT

I've been working quite a bit on something I can only describe as a "threaded canvas" for some time now. In a moment I'll describe what I have, but since I'm really open to new ideas, existing solutions or a completely fresh start, I'll formulate the problem. The canvas is intended to display genetic information (although the specific p...

Using flot (or another canvas plotting javascript package) in a modal dialog box

Hi guys, I'm trying to to display a chart (generated using flot) in a modal dialog box. The plot is a blown up version of a smaller chart. From my initial attempts I can't seem to display a chart. Would this be a limitation of the canvas tag? Any ideas? ...

addEventListener in Canvas tag

Javascript - Canvas tag - HTML5 Hello, I have a canvas tag to create a graphic. At each section of my line, I have a "dot" to enable a 'mouseover' and display more detail. Everything works fine when I don't add an event listener to this dot. Firebug is warning me : s.addEventListener is not a function... Is it possible to create dyn...

Javascript/Canvas/Images scaling problem in Firefox

I have a problem with the context2d's drawImage function. Whenever I scale an image, it gets a dark border of one pixel, which is kind of ugly. That does only happen in Firefox, not in Opera or Webkit. Is this an antialiasing problem? For hours I studied the examples and available documentation without getting rid of it... I couldn't ye...

Binding a list of controls to a canvas

Is it possible to bind an OvservableCollection of Labels or and FrameworkElement to a canvas? If so how can this be implemented? ...

How to draw an arrow in Silverlight.

I need to draw an arrow between controls in a canvas. Currently I'm using the Line object but it doesn't have a way to draw a triangle at the end of the line. This is roughly what I need: [TextBox] <----- [Button] I was trying to subclass Line and add a couple of lines at the end but the class is sealed. How would you build a custom...

Flex: Difference between defining sprite's x, y coordinates, and painting object in some location

I have a task: I need to place about 100 sprites on one canvas (with prepared grid on it). I need to place them as invisible (circles) stones, on the board, and make visible only on mouseover. The problem I come across is following, I can't place those objects accurately into the nodes on the grid. E.g. if I define stones (it's just...

export canvas data to json

Hay guys, i've made a simple drawing application using the canvas tag. However i would like to export the data to JSON so it can be saved. How does one go about this? ...