canvas

Possible to draw in YCbCr in Java?

Hi everyone, I've a project at the moment, in Java, which uses a filetype which is inherently in the YCbCr colorspace. Within this, there is a lot of number crunching happening behind the scenes (which I've had to code) to convert to RGB from the YCbCr values. This is done per-pixel, per-frame, at 25 frames per second... The project mu...

Canvas, scrolling and special use case in Flex

Hello guys, I have a canvas of variable width and height with a maximum being 2K*2K This canvas current height and width vary depending on the user screen size. Usualy smaller than 2K*2K. If the user moves an element (free moving elements like child UIcontainer) inside the canvas at position greater than the current user available H a...

Selecting an object on a WPF Canvas?

I have a WPF Canvas with some Ellipse objects on it (displayed as circles). Each circle is from a collection class instance which is actually a custom hole pattern class. Each pattern has a certain number of circles, and each circle then gets added to the canvas using an iteration over the collection using the code below. So, the canvas...

MouseLeftButtonDown on canvas requires too much precision

I am responding to MouseLeftButtonDown events on elements added to a WPF canvas. It all works fine when clicked (i.e. the eventhandler fires off correctly), but it requires too much precision from the mouse pointer. You have to be perfectly on top of the circle to make it work. I need it to be a little more forgiving; maybe at least 1 or...

Creating an image with canvas in Javascript

I seem to have hit an error message that I'm having a hard time debugging. What I'm trying to do is dynamically create an image such as this one ( http://www.webreference.com/programming/javascript/mk/column3/creating/cp_mini_gradient_details.png ) with canvas. The error message I'm getting is: [Exception... "An invalid or illegal str...

WPF: Best (reliable) way to translate (move) a Canvas AND monitor Every step

I have tried translating (moving) a canvas but I'm having trouble with the timers. I tried 2 different methods: First method was with the BeginAnimation function, and the second with DispatcherTimer ticks, but they're both very unreliable. I need to monitor every step of the translation. With the first method I tried (BeginAnimation)...

Drawing Application Zoom Concept

I'm building an application on top of canvas, it consists of a simple DOM that gets redrawn on every mouse move (yes, it is necessary), for performance issues not every part part gets redrawn only what is needed. The app is working well but I'd like to add the zoom feature, the way I see it, it can be done in three different ways: 1 - ...

Drawing a rectangle on a flex canvas is there a better way than ...

Hello, To draw a "selection rectangle" from the mouse down , mouse move then remove it on mouse up i currently do the following: My board is a canvas, On mouse down i create a new UIcontainer i set his borders. I update his width and height related the the mouse move position, on mouse up i remove this child UIcontainer. Do i have to ...

Databinding items to Canvas

I have a userControl that contains a canvas. I would like to databind items to it so they are positioned automagically. Here's a great example that shows how to databind items on a canvas, but I want it to work on my specific userControl. (I believe it's not possible to specify a userControl in a ItemsPanelTemplate) ...

Binding a line to the edge of an ellipse

On a canvas I have an ellipse rotated by a RotateTransform through animation. I wish to add a line with one end attached to a point on the ellipse. Can I somehow bind to a point on the ellipse? ...

Internet Explorer toDataURL() alternative?

So I need to save image data drawn on a <canvas> element. And there is the toDataURL() method which works in most modern browser. Except... you guessed it... Internet Explorer. I've searched the internet but everywhere people say I should use SVG/VML to save the data, but they never mention how. I have not any experience with SVG/VML i...

Javascript Sprite Animation Library for Canvas Tag

Can you point me to a good Javascript sprite animation library using the HTML Canvas tag? A few Google searches only turned up some non-canvas projects. I am looking for something clean and simple. Thanks. ...

Canvas utilities for Silverlight 2

To save me writing the code, does anyone know of a source for utility code for working with Silverlight canvases? I am thinking of code that determines bounding boxes for content, content within clipped bounds, easy access to Transforms etc. ...

How i can change canvas context stroke on a typeface hover? stroke() doesn't work

Hi to all, this is a related Firefox problem. I have a menu in which is applied typeface script. Typeface 0.11 version doesn't support hover on links. There is an experimental version but doesn't work very well for me, so i tried to implement hover by myself. Problem is: hover works pretty well changing canvas context property fillCol...

WPF - How to dock a Border onto a Canvas?

I have a Border inside a Canvas. The Border's height/width are varying according to its contents. I want the Border to stretch out to fill up the entire Canvas. How can I do that? I have tried this on the Border without success: Height="{Binding ElementName=MainCanvas, Path=Height}" Width="{Binding ElementName=MainCanvas, Path=Width}"...

Drag and drop in mozilla canvas

Hello All, I want to implement a drawing pane (similar but smaller version to what visio gives for flow charts) in mozilla canvas. Is there any support for this? I have used jQuery till now to create the rectangles and move them around. While this is easy here..creating lines (connections between objects) is a real pain. I am using so...

getPixel from HTML Canvas?

Is it possible to query a HTML Canvas object to get the color at a specific location? ...

Is there a way to automagically make a canvas scroll on overflow in WPF ?

Hi all.. Been checking the web and this site, but couldn't come up with any descent results. Is there a way to make a canvas in WPF show scrollbars on overflow ? Been trying the scrollviewer, but can't get it to work :( Thanks in advance.. ...

How to retrieve coords (x,y,w,h) of a rendered canvas element?

How i can get coords of a rendered canvas element? I need them to apply clearRect, fillRect etc to its area. I get the canvas: //html <div><canvas id="canvas_id">some useless text..</canvas></div> //javascript var ctx = document.getElementById('canvas_id').getContext('2d'); Then? there is a way to get top left x, top left y, widt...

Javascript - get pixel data from image under canvas element?

You can sample pixel color data on a canvas image with getImageData(). If I layer a transparent canvas element over a background image or flash movie, can I sample a color from that via the canvas tag? ...