canvas

Capture HTML Canvas as gif/jpg/png/pdf?

Is it possible to capture or print what's displayed in an html canvas as an image or pdf? I'd like to generate an image via canvas, and I'd like to be able to generate a png from that image. ...

How do I print a partially transparent image to a PDF Canvas using Delphi?

My program needs to output a (fairly complex) form to the printer, including several images. I’m currently doing this using Delphi (2006)’s Printer.Canvas, after selecting a PDF printer (PDF995). This works like a treat. However, I’m now running into a problem: there’s one partially transparent image that needs to be placed on top of ...

Andrioid: Efficiently scrolling the contents of a Canvas?

I want to draw a graph that updates in real time (grows from the right). The most efficent way I can think of to do that would be to copy everything from x[0 .. width-2] left by 1 pixel, then draw the new value at x[width-1]. I have little experience with Android, but from what I can tell, Canvas doesn't operate on it's contents at all...

Does anyone could make Excanvas work in IE 8 with jQuery?

I used to work on a jQuery plugin named 'BeautyTips' and it was working just fine. But, since I've installed IE 8, this plugin stop working 'cause it needs Excanvas to make IE draw the vectors, images etc. I've tried to download the newer version of Excanvas but it's not workint at all... thanks ...

How can I modify HTML Canvas colors using an interval loop?

i wrote this and wanna start and end the loop with certain colors (e.g. start with rgb 150,150,200; end with rgb 190, 160, 200): <!DOCTYPE HTML> <html> <head> </head> <body> <canvas width="400" height="100"></canvas> <script> var context = document.getElementsByTagName('canvas')[0].getContext('2d'); var lastX = contex...

Smooth animation in javascript

Is there a way to draw smooth animation in javascript? In directx I'm using the vertical synchronisation. Can I achieve this in a html canvas? ...

Java repaint not working correctly

i use the java repaint method , it repaints, but the update is only seen when I either click on the canvas or resize the panel. How can I fix this ? What causes it? ...

Firefox throwing a exception with HTML Canvas putImageData

So I was working on this little javascript experiment and I needed a widget to track the FPS of it. I ported a widget I've been using with Actionscript 3 to Javascript and it seems to be working fine with Chrome/Safari but on Firefox is throwing an exception. This is the experiment: Depth of Field This is the error: [Exception... "An...

In HTML5, can you save an image to cache programmatically?

I love that in HTML5 you can save text data out to a local database, and can even use SQL to do it. (http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/) I've got an app that I've written for the iPhone's MObile Safari that caches everything offline except for images. The images still have to be downloaded from t...

Are there any drawing plugins for RoR or JQuery?

I am writing a web based application using Ruby on Rails. In one of the forms the users would need to draw something with a mouse and label the object with some text. In short, I need a Simple paint like application on which I can draw with a mouse. Write simple text. Store the painted diagram as a file for future editing. Export...

Silverlight 3 - ScaleTransform or other method to zoom in a Canvas?

I need to be able to zoom in and out of a Canvas using the mousewheel. I have successfully set up the mouse wheel handlers and am currently using a ScaleTransform to apply the zoom; however, the scaling is not done in an "intuitive" way. I'm trying to accomplish the same style of "zooming" as you can see in MultiScaleImage, Google Ma...

Is there a way to tile a background image over a canvas path?

For example, I have a canvas in a page with some kind of a path. It is created by javascript this way: var context = $('#some_canvas').getContext('2d'); context.beginPath(); context.lineWidth = 5; context.strokeStyle = '#000000'; context.moveTo(0, 0); context.lineTo(100, 100); context.stroke(); Is there a way to make the path that app...

How do I bypass a same origin policy violation for one local file to another?

I'm trying to semi-recreate Mozilla's demo usage of JavaScript + <video> + <canvas> with files that aren't hosted on a server. Loading my document causes the error console to report this error: Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "file:...

Algorithms for positioning objects in a canvas

Where can i find some algorithm to position some objects in canvas in a clever way? I'm using javascript (with Raphael svg library), but examples with other languages (or pseudo-language) are welcome. Geometry isn't my strong point =) For example have 600x800 canvas, and i want to place n objects sized 60x60 in smart ways, for example: ...

How do I work with a Canvas / JCanvas in Netbeans

In netbeans it is possible to add a canvas to your app, however it does not seem possible to draw on the canvas because you need to overload the paint(Graphics) method. What is the best way to do this? Thanks! ...

Save <canvas> contents to be redrawn in later animation frames?

I am drawing a graph on a <canvas> that requires expensive calculations. I would like to create an animation (when moving the mouse across the canvas) where the graph is unchanging, but some other objects are drawn over it. Because the canvas will have to be redrawn a lot, I don't want to perform the calculations to render the graph fo...

Grid vs. Canvas

I'm looking for opinion on using Canvas vs. Grid panels in WPF. I need to make classic input forms that have basically grid layouts, some may have small datagrids inside, groupboxes, but all aligned in grid layout. I’m struggling whether to use Grid or Canvas panel for all my forms. Grid is giving me good structure; I can maintain alignm...

Using NetBeans IDE 6.7 with J3D's Canvas3D Container

I keep telling myself that this should be simple, and yet I'm completely lost. Let me start by saying that I'm new to NetBeans IDE, and that I am using it out of necessity. I don't really know much about it yet. I have successfully designed my main window for my application. The right side of the application is essentially a large windo...

jQuery - use canvas to draw lines between divs

I have n <div>s, each with <h1> title and <ul> list of items in. I would like to float these over a canvas and draw lines from <div id="x"> list item y to <div id="z">. I am using jQuery UI to make the <div>s draggable. The canvas element is part way down the page (a paragraph of text and some form elements precede it) but I can change...

Visual C++ application as a frontend to MS Access database - multiuser data access and canvas-like GUI questions.

In company that I work for, I was given the opportunity to write an application, which would replace the old Excel workbook, which is used to plan the production queue. Because VBA was simple and Excel was easy to use, for few years this workbook was used by several people to plan/add changes/notes about current production status. Whole ...