canvas

context.scale() with non-aspect ratio preserving parameters screws effective lineWith

I am trying to apply some natural transformations whereby the x axis is remapped to some very small domain, like from 0 to 1, whereas y is remapped to some small, but substantially larger domain, like 0 to 30. This way, drawing code can be nice and clean and only care about the model space. However, if I apply a scale, then lines are a...

How to add canvas in MFC Dialog?

I want to create an application which main window has canvas (or something where I can draw custom things) and some controls, like buttons and edit fields. But I got stuck about how to do it. I tried to create MFC with SDI, but how to add control to CDC..? I tried to create one dialog with buttons and edit fields, but which control refe...

Using HTML Canvas for UI elements?

Hi, I have a couple of UI elements such as buttons in my web application. I was going to use CSS3's transitions to animate the transition from one background-image to another. I figured out that it's not possible with the current transitions draft at least. So, I was wondering if it would make sense to use Canvas as the button. I'm sure...

WPF image cropping

I'm loading layers of images to make a single image. I'm currently stacking them all onto a canvas. I've got it set up so the user can specify the final dimensions of the single image, but even when I change the size of the canvas the images retain their original sizes. I tried to modify the image size as I was loading them in, but th...

WPF: Canvas Events Not working

Hi I have set Mouse Events on a canvas as follows MouseUp="CanvasUp" MouseDown="CanvasDown" MouseMove="CanvasMove" But these are active only on the child elements like Images and Rectangles, but not on the empty space. Please tell me how to solve Thanks ...

Building Visual studio like application, need inputs..

Hi, I am working on a Visual studio like application i.e. have a tolbox, an editor and property grid similar to VS. User can drag and drop the controls(custom and third party) to the editor window and perform operations like resize, move, align, group etc.; Properties of that control needs to be displayed in property grid and user can ...

WPF Canvas Binding

Hey guys, I'm rather new to WPF, so maybe this is a simple question. I have a class that derives from Canvas, let's call it MyCanvas. And I have a class, MyClass, that has a property of type MyCanvas. In XAML, I built a TabControl, so each TabItem binds to a MyClass object. Now, in the Content of every tab I want to display MyObject.MyC...

How to create the border of a dynamic canvas in Silverlight?

Hi I am creating a Canvas in code behind like below: Canvas musicPlayerCanvas = new Canvas(); musicPlayerCanvas.Background = new SolidColorBrush(Colors.White); musicPlayerCanvas.Height = 80; musicPlayerCanvas.Width = 1018; LayoutRoot.Children.Add(musicPlayerCanvas); musicPlaye...

HTML5 Canvas Colour Text

How do I add colour to my text in canvas. When I tried fillStyle the text just stayed black. ...

How to interact between GameCanvas and LCDUI elements on J2ME?

The thing is I writing a J2ME program that fisrt of all show a "menu" using graphics interface (GameCanvas) and when the user select one item, I need to setCurrent that item (ex. a List), but when return from the List (it could be because the user push a Command "Menu" Item) I need to show the menu again. The real problem when the menu...

WPF Bind User Control Coordinates

Another beginner WPF question from me :) Ok, so I have a User Control added to a Canvas. In another area of the application I have two TextBoxes that will get 2 values : X and Y. I need a two-way binding between the user control's top left corner coordinates and those 2 textboxes. I don't mind implementing a Converter or doing some cal...

How to save HTML5 canvas?

Currently I am using Canvas2Image to save the content of my HTML5 canvas. It doesn't appear to work in Google Chrome, however. Any ideas on how to work around the issue are welcome. :) ...

javascript canvas rescaling and drawing on image

Hi all. How can I use the Canvas to draw over images downloaded by users, while scaling it. for example: 1. user uploaded image 2. began to draw on it 3. zoom out and continued to draw more and all changes are applied to the original image. p.s ssory for my engilsh:( ...

Can you have multiple clipping regions in an HTML Canvas?

I have code that loads a bunch of images into hidden img elements and then a Javascript loop which places each image onto the canvas. However, I want to clip each image so that it is a circle when placed on the canvas. My loop looks like this: $$('#avatars img').each(function(avatar) { var canvas = $('canvas'); var ...

Composite operations in Android Canvas

I'm just starting with Android development and I'm coming from JavaScript/HTML world so I'm currently investigating the possibilities of the Android SDK. The HTML 5 canvas supports composite operations (See here). Is this possible in an Android Canvas? I scanned the API of the Canvas class but couldn't find anything useful. I need at l...

how do I measure the stroke angle?

I am working on wpf project, I want to know how to measure the angle of the stroke on the ink canvas? whether the stroke is right inclined or left inclined? ...

Is there a redraw-event for HTML5's canvas element?

As the title says, I need a notification when the content of a canvas element was redrawn. Is this possible? If not, a notification when the whole page was redrawn would also be ok (reDRAWN not reLOADED!). The reason why I need this is that I want to get the current FPS of an animation running inside a canvas. ...

Div positioning on a canvas with arrows bindings

I'm searching for a little piece of javascript that can attach to a div (in data-x data-y attributes for example) the x,y coordinates of a draggable div. And then be able to draw arrows between them (using a data-targetid attribute?). If the solution can look like a simple version of graphview, jsPlumb or vizster but without the compli...

Point data structure for a sketching application

I am currently developing a little sketching application based on HTML5 Canvas element. There is one particular problem I haven't yet managed to find a proper solution for. The idea is that the user will be able to manipulate existing stroke data (points) quite freely. This includes pushing point data around (ie. magnet tool) and manipu...

With the introduction of the HTML5 <canvas> element, could Swing be implemented in GWT?

With the introduction of the HTML5 <canvas> element, could Swing theoretically be implemented in Google Web Toolkit (GWT) by using the <canvas> tag for drawing? I'm aware of efforts to port source code from using Swing calls to GWT calls, but what I'm after is a pure behind the scenes port where a Swing application would compile under G...