canvas

How To Get DIV Coordinates Within HTML5 Canvas?

Is there a way for me to get the absolute position of a DIV element within a HTML5 Canvas element? Any help is greatly appreciated. ...

retain bitmaps on canvas in android

I am using android 2.2 & creating live wallpaper based on cubewallpaper example in android sample I am loading array of bitmap one by one on a canvas after few interval of time at the same place/position i,e, X and Y position (it is one type of rotated image banner). Now the problem is If i am locking the canvas using following code ...

3d drawing in Canvas with HTML+JS

Is there any framework/engine that provide ability to draw 3d images on Canvas? I am planning to draw some primitives (different shapes) located in one plane: var dist = 2; var hexHalfW = 35; var lengthX = 20; var hexR = Math.sqrt(lengthX*lengthX+hexHalfW*hexHalfW);//40.31128874 var hexDiag = 2*hexR; var hexHeig...

HTML5 canvas stroke() thick and fuzzy

I'm trying to allow the user to draw a rectangle on the canvas (like a selection box). I'm getting some ridiculous results, but then I noticed that even just trying the code from my reference here, I get huge fuzzy lines and don't know why. it's hosted at dylanstestserver.com/drawcss. the javascript is inline so you can check it out. I ...

two questions about rectangle and canvas in silverlight 4

I have a rectangle on canvas. I can already moving this object using with mouse, but I can't find how can I resize it in runtime using mouse too? And second question, how can I programatically check positions of each objects (e.g rectangles) on the canvas? ...

Chrome Canvas Linear Gradient != Firefox Canvas Linear Gradient

Well , the problem is the next : canvas = GreenCanvas.get(0).getContext('2d'); grad = canvas.createLinearGradient(0,0,255,0); grad.addColorStop(0, 'rgb('+r+','+0+','+b+')'); grad.addColorStop(1, 'rgb('+r+','+255+','+b+')'); canvas.fillStyle = grad; canvas.fillRect(0,0,256,34); 256 pixels . from for example rgb(0,0,0)...

Drawing transparent TMetaFile on TCanvas in Delphi

I would like to draw a transparent TMetaFile on a Canvas, used for print watermark. The problem is AlphaBlend function won't recognize TMetaFile.Handle as source as it expects canvas handle. I created a 32bit bitmap with transparency but drawing on it will force white background thus on Canvas you can see an alpha blended rectangle. Ho...

How can I create and interact with a canvas element in node.js?

I'm writing a canvas-powered multiuser drawing application in Node.js, and want to maintain an internal canvas element with the current drawing. Is it possible to create and interact with a canvas element in Node.js? My latest try was the jsdom module available here: http://github.com/tmpvar/jsdom var jsdom = require('jsdom'); var win...

Obtaining the urldata of a background-image with Javascript (possibly using canvas)

Let's assume there is a DIV element and it has CSS background-image property. I want to get urldata(base64) of the background image with Javascript. I can get urldata of IMG elements but how about this one ? Thanks. ...

Drawing a triangle in a coordinate plane given its three sides

The length of three sides of the triangle, a, b and c will be given, and I need to find the coordinates of the vertices. The center (probably the circumcenter) can either be the origin or (x,y). Can anyone point me in the right direction? ...

Android drawCircle with different colour border

Hi, Is it possible to draw a circle on a canvas in android with a different colour border using only one drawCircle method? I have noticed the PaintStyle of FILL_AND_STROKE but cant seem to have different colours for both the fill and the border. I really don#t want to have to call two drawCircle methods. Thanks ...

Why is drawing bitmaps is very slow on some android 2.2 phones?

I have a simple card game where the user can drag and drop cards around the screen. On some of the 2.2 android phones like the Droid and EVO the card drawing is very slow. This is strange because it happens on some of the faster phones. However it's not all phones I test on the Droid and Droid X and the program runs great also runs good ...

transforming in html canvas

ok, how can I transform a html canvas from a square to a trapezoid? so ___ | | |___| to ___ /___\ ...

why my invoke of Canvas.drawText() just doesn't work

Hi all: I'm writing a class that inherit from TextView, and override its onDraw() method, but in the method, my invoke of canvas.drawText() doesn't seems to work, the code just like below: protected void onDraw(Canvas canvas) { // super.onDraw(canvas); Paint paint = new Paint(); paint.setColor(android.graphics.Color.WHITE...

Implement faster graphics operation on WPF Canvas

Hi, I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50*50 or 100*100 rectangles of 4 pixel each) but it is slowing down...

Canvas to Image

I need to convert the canvas tag into a image file and it need to support the IE6+,Mozilla 3+ and saffari 5+ ...

converting a canvas into bitmap image in android

I am trying to develope an app on canvas ,i am drawing on canvas with bitmap .After drawing,i am trying to convert into bitmap image . can anyone give me suggession thanking you in advance ...

HTML5 drawing with "replay" feature"

I am trying to implement a html5 drawing app. Currently, I can allow for a drawn image to be saved. I want to be able to have a replay feature that redraws the image the same way that it was originally drawn almost as if it were a video. Any ideas? ...

How Does the Wilderness Downtown Google Map Work?

Hi! I was just watching the Wilderness Downtown video - http://www.thewildernessdowntown.com/ - and I couldn't quite work out how the folks behind it did the Google Map which scrolls along and rotates, all on an HTML5 canvas. I've looked through the Google Maps Javascript API - http://code.google.com/apis/maps/documentation/javascript/...

I've placed a <canvas> element inside a <div> and it dissapears. What gives?

I'd like to to make the canvas element (processing.js) resizable using jquery. ...