canvas

Rotating an image in all browsers (canvas in IE?)

I finally got to work with canvas only to find out that it is not implemented in IE. I tried explore canvas from google to use it in Internet Explorer, but it's not working for my code (http://uptowar.com/test.php - little bug though that it is not removing the old image when rotating). So, is there an other way to smoothly rotate an im...

[JAVASCRIPT/HTML5] Howto equal Microsoft.Matrix filter to canvas rotate?

Is anyone able to help with this universal rotate function (it's for jquery, but this is a javascript thing) : http://pastebin.com/m382b30e I changed the non IE canvas code so it'll rotate around the image's center (see http://uptowar.com/jquery in firefox). Now I need to change the IE microsoft filter to do the same (see the same url i...

How can I align text inside a GnomeCanvas text item

I would like to have a GnomeCanvas text item and according to its content (and the content language) decide whether to align the text to the right or to the left. I found one way to do it by changing the anchor property, but using this method would require me to manage the anchor position myself (change it to the right of the text boundi...

getting and handling the key presses in a J2ME GUI application

Hi, i am quiet new to J2ME GUI programming (or developing with java in general), so this question might sound very basic to some of you. I am going to ask it anyway since i can't figure out how to do this. Here it is: I programmed a bluetooth TV-Remote control for cellphones in J2ME using javax.microedition.lcdui.* (Gauge, List, ChoiseG...

Rotating a Div Element in jQuery

Trying to rotate a div element...This might be DOM blasphemy, could it work possibly with a canvas element? I'm not sure - if anybody has any ideas of how this could work or why it doesn't, I'd love to know. Thanks. ...

resize images with canvas - css overflow issue

Hi, I'm working on a Javascript image resizing feature which rely on the IE only DXImageTransform addon. Wanting to address modern browsers as well, I gave a shot to canvas, with pretty good results. However, I face an issue in my resize function, which is the following: function Resize(oObj, flMultiplier) { var canvas = do...

Painting a Canvas in an Applet

Hi all, I currently have a small Java program which I would like to run both on the desktop (ie in a JFrame) and in an applet. Currently all of the drawing and logic are handled by a class extending Canvas. This gives me a very nice main method for the Desktop application: public static void main(String[] args) { MyCanvas canvas = ...

How do I fix shocking/lagging movement in this ajax based multiplayer example?

EDIT: important, examples must be used in firefox 3+ due to html5 elements. Hi there, I'm trying to find out more about the potential of AJAX in a browser based multiplayer game. To do so, I'm testing out movement with AJAX and a space shuttle as a character. This space shuttle is rendered with canvas (html5). My first version is read...

How to refer to Canvas in another XAML File?

I have a problem with figuring out how to refer to a Canvas in another XAML file in my project, for example there is a Canvas object containing some labels, images called MyLayout and is stored in MyLayout.xaml I want to use this Canvas in the main Window of the application in Window.xaml - how can this be done, as there will be multiple...

How to save entire Scrollable canvas as Png

I have a Canvas class that implements VirtualizingPanel and IScrollInfo. This class is contained inside a ScrollViewer. How can I save the contents of the entire Canvas class only as Png? I know how to save as Png, problem is what is the easiest way to grab only the particular control. When the control is out of view, it gets clipped ...

Charting libraries in PHP output to SVG or Canvas?

I'm looking for a charting library written in PHP that outputs to SVG (or Canvas), possibly for integration into an ExtJS project. I like the look of http://pchart.sourceforge.net/index.php but it does bitmap output and is GPL licensed, which will probably be a show-stopper since the project is an internal commercial project. Any sugges...

Force canvas element in html to take up the entire window?

Instead of <pre> <canvas id="theCanvas" width="500" height="500"></canvas> </pre> where I specify the size of the canvas is there a way to make the canvas take up the entire browser window? ...

How to make the Canvas clip its contents in Flex?

I draw a line on a Canvas object with the moveTo and lineTo graphics methods. If one end of the line lies outside the Canvas, the line spills out and is drawn over or under other elements in the application. How do I make the Canvas keep the line contained within itself? Thanks! ...

How to incorporate Canvas into a larger layout in WPF?

Canvas doesn't seem to play well together nicely with the other elements when you try to build it into a layout and have e.g. controls on the side and the canvas is the drawing area. For instance, why can I put a border around every element except a canvas? In the following code, border wraps canvas but the canvas only has the border on...

WPF: Speed of Movement (Translation) varies with distance

With reference to this programming game I am currently building. I wrote the below method to move (translate) a canvas to a specific distance and according to its current angle: private void MoveBot(double pix, MoveDirection dir) { if (dir == MoveDirection.Forward) { Animator_Body_X.To = Math.Sin(Heading...

Is there an analogue to Qt's QCanvas in Windows Forms?

I've written a Windows Forms application to solve Shikaku puzzles. At the moment, the puzzle grid is drawn on a Panel in the app's main window using a PaintEventHandler. The method called by the PaintEventHandler redraws the entire grid every time it is called. Whilst this approach works, it is flickery and inefficient, and I would li...

How to stop Mouse Out event on Flex Canvas firing for child elements

Hi, I am using a Canvas itemRenderer for a container I use to display images. See pseudo code below. image = new Image(); image.source = data.@thumb; this.addChild(image); this.addEventListener(MouseEvent.MOUSE_OVER, enlarge(image)); this.addEventListener(MouseEvent.MOUSE_OUT, shrink(image)); When I mouse over the canvas, the enlarge...

How do you convert a color image to black/white using Javascript?

How do you convert a color image to black/white using only Javascript? AND, also make it cross compatible in most browsers because I hear Internet Explorer has a "filter" mechanism but no other browsers support it. ...

Can canvas tag be used to draw on top of other items on a page?

Can an HTML canvas tag be positioned over other html content on a page? For example, will something the following CSS declaration make a canvas tag do what I expect it to? canvas.mycanvas { position: absolute; background: transparent; z-index: 10; top: 10px; left: 10px; } ...

SVG vs CANVAS, where is the Web World going towards?

I need to pick one of two technologies (svg, canvas) for an ongoing project of mine. I would prefer to pick the technology that is more maintained and in active development rather then choose a technology marked for "putting down". Which of the two should I choose? Is there a good JS library built on top of them? ...