How can I take a path such as what you see below and have Javascript make a visible circle or dot based on the path class ? As well output the points based on a canvas coordinates, canvas name being irrelevent, I hope ? ;-) <path class="st0" d="M73.3,73.1"/>

Member Avatar
Member Avatar
+0 forum 20

As what was stated on the header I want to implement either a "paint" or "eraser" function whichever feature more convenient for user to edit paint/censor unwanted parts of a photo displayed on a imageview before uploading it to a server in the edited format and a redo function if user makes a mistake while editing? How do I come about doing it, I've read relevant topics on Canvas, or FingerPaint but still puzzled on how to implement it based on the scenario in this link [here](https://drive.google.com/file/d/0B2rvGRbu0A83LU1pQjRicnNFS0U/view)? Thanks for any help rendered! idImage = (ImageView)findViewById(R.id.idImage); Bitmap bitmap = null; bitmap …

Member Avatar
Member Avatar
+0 forum 1

I have made a project in Html5 canvas and this is responsive for all devices. The mouseClick, Drag and Rotate events in canvas are working fine on desktop pc and Laptop. But touch is not working in mobile and tablet devices. What should I do?

Member Avatar
Member Avatar
+0 forum 1

I've been trying out the HTML5 <canvas> element, and cannot get it to work. here is my code: [CODE] <html> <head> <script type="text/javascript" > var canvas=document.getElementById("canvas"); var context=canvas.getContext('2d') context.fillRect(100,100,300,300); </script> </head> <body> <canvas width="500" height="500" id="canvas" /> </body> </html> [/CODE] The canvas is there (I confirmed this), but nothing is on it. A javascript editor gives me this error: Uncaught TypeError: Cannot call method 'getContext' of null Does anyone know why?

Member Avatar
Member Avatar
+0 forum 2

Draw a group of shapes on the Tkinter GUI toolkit canvas and animate the group using the common tag names.

Member Avatar
+1 forum 0

i am trying to draw an image on to a php page using the imagecreate function but the image is not showing, i cant see the problem with this code, please help me out, the code is as follows: <?php header('content-type: image/jpeg'); $fontSize = 30; $imageHeight = 40; $imageWidth = 200; $image = imagecreate($imageWidth,$imageHeight); imagecolorallocate($image,10,120,0); $textColor = imagecolorallocate($image, 0, 0, 0); imagettftext($image, 20, 0, 15, 30, $textColor, 'font.ttf', 'james'); imagejpeg($image); ?>:

Member Avatar
Member Avatar
+0 forum 1

In my ASP.NET MVC application, I am trying to put together a page where a user can both sign and print their name once at a workstation equipped with a Wacom. The signatures will be saved to PNGs with links in a database and then stamped in the designated area of each form, upon user approval. With just one signature canvas, the process works flawlessly. But even with 2 separate Javascript files, I can get one canvas working fine, but cannot get the other canvas to draw. If I split the canvases onto 2 different pages, they each work fine …

Member Avatar
Member Avatar
+0 forum 9

Hello guys, I have a project to save an image from canvas to file. I have tried googling for 3 days and nothing works. Can anybody show me how to do it. I have search from this forum and this is what i get. http://www.daniweb.com/software-development/java/threads/436548/saving-canvas-as-image " Create a new buffered image. Get its Graphics. Draw your canvas on the Graphics. (Use your existing paintComponent method and pass the BufferedImage's Graphics to it.) " well i dont realy understand how to code it. Please give me an example how it should be done. Thanks.

Member Avatar
Member Avatar
+0 forum 4

Hello, I have been able to drag and drop images from a toolbar to a html5 canvas. And now i need to connect two images/objects with a arrow. Basically the scenario should be, when you click on a dragged object, conncetiong points should appear and by dragging one point to another point on another image will cteate a arrow. Can anyone help me on achieving this? Thanks in advance.

Member Avatar
+0 forum 0

hello, i had done lot of things with canvas like drawing different shapes on it,attaching note on it..now i have a little challenge for me where i have to imitate MS word's elbow connector to be drawn on my canvas..does anyone have ever tried doing something like this???If yes please share..

Member Avatar
+0 forum 0

Hi, I have this wierd situation: I am trying to animate 2 images going one past the other on the canvas. I have a function to calculate their new locations etc, and when it's time to play the animation in calls another function to render the new state of the images. Now, that render function removes the "tile" around both images and places the background back instead, and then redraws the new images there. The result i am getting is that only the background is now seen. when i neytralize the bg drawing, i see that the images are getting …

Member Avatar
+0 forum 0

When I draw on my HTML5 canvas, it is zoomed already? Hence drawn arrow below is blurred! (snap attched). What is the Reason? Any help to avoid this? var ctx = document.getElementById("canvasWhiteboard").getContext("2d"); ctx.beginPath(); ctx.moveTo(touchX, touchY); ctx.lineTo(moveX, moveY); ctx.lineWidth = 4; ctx.strokeStyle = "black"; ctx.stroke();

Member Avatar
+0 forum 0

Here is the code, how would i go on about making the bullets fired (size 6x6 pixels) collide with the blocks currently on the map and with enemies (48x48 pixels) which are to be implemented? Desperatley need a solution! // inner variables var canvas, context; // canvas and context objects var imgBrick, imgSteel, imgWater, imgForest, imgTank; // images var aMap; // map array var oTank; // tank object var bullets = []; var iCellSize = 24; // cell wide var iXCnt = 26; // amount of X cells var iYCnt = 26; // amount of Y cells // objects : …

Member Avatar
+0 forum 0

I need a way to store x y height and width in 4 jquery variables I was thinkink about the jquery ajax get but don't know how to achive this. This is my code <?php $result = $pdo->query('SELECT * FROM figures'); foreach ($result as $row=>$value) { echo '<li>'."My value is" .$value['x'].'</li>'; echo '<li>'."My value is" .$value['y'].'</li>'; echo '<li>'."My value is" .$value['height'].'</li>'; echo '<li>'."My value is" .$value['width'].'</li>'; echo "</br>"; } ?> Any advice or help is apreciated thank you

Member Avatar
Member Avatar
+0 forum 6

with a little research a come up with my script in creating a canvas that would look like this. ![54d736fd19df9f8ac8a05733938b3e59](/attachments/small/2/54d736fd19df9f8ac8a05733938b3e59.png "align-right") it has a multiple link one link per circle. function binTree(aData, source, baseLink){ var canvas = document.getElementById(source), c = canvas.getContext("2d"); c.translate(0.5,0.5); c.fillStyle = "#ffffff"; c.fillRect(0, 0, canvas.width, canvas.height); c.strokeStyle = "#000000"; c.strokeRect(0, 0, canvas.width-1, canvas.height-1); c.lineWidth = 1; c.font = "12px monospace"; var canvasWidth = canvas.width; var initPosXPower = 1; var initPosx = 2; var initPosy = 50; var TWO_PI =Math.PI * 2; var Links = []; var hoverLink = ""; c.textBaseline = "middle"; c.textAlign="center"; for (var i = …

Member Avatar
Member Avatar
+0 forum 2

I've got a web page that allows the user to create a canvas that can be as much as 50,000 pixels on a side (they're maps). I draw everything on a canvas, scaled to the user's viewport. Unfortunately, you can't print a canvas; you have to convert it to an image and print that (at least, that's what I understand). I'd like to print something the size of the user's paper, but am at a loss to how to figure out that size, or even proportions so I can create a scaled view. So, to print a map, I have …

Member Avatar
Member Avatar
+0 forum 1

I have the following code to draw any polygon on an HTML5 canvas on a button click. The user supplies the radius, sides, x and y co-ordinates. Using the sides any regular polygon should be drawn. First we move to the perimeter using moveTo() and then draw lines using lineTo() depending on the sides. js.js function drawPolygon() { var numberOfSides = parseFloat(prompt("Enter number of sides")); var Xcenter = parseFloat(prompt("Enter x")); var Ycenter = parseFloat(prompt("Enter y")); var size = parseFloat(prompt("Enter radius")); var con=document.getElementById("myCanvas"); var cxt=con.getContext("2d"); cxt.beginPath(); cxt.moveTo (Xcenter + size * Math.cos(0), Ycenter + size * Math.sin(0)); for (var i = …

Member Avatar
Member Avatar
+0 forum 3

Hi I am trying to create this application where I need to create a panel with different buttons. I can select a button and drag a button on to a canvas. Can anyone tell me how to create a dragging button.

Member Avatar
Member Avatar
+0 forum 2

I'm currently taking a course where I'm required to work on a Javascript/HTML5 or CSS projects. I have a month from now till the deadline. I'm thinking of making a Javascript/HTML5 simple game. Before I start on anything, I would like to hear from you, what would be the most suitable library for beginners in games making field? I only have 1 month to learn and code on the go, 3-4 hours daily. Note:I'm not an expert in JS nor that beginner. Please kindly, move the thread in its suitable subforum if this isn't.

Member Avatar
Member Avatar
+0 forum 2

Whats up people So i have been trying to figure out how can i make the background be the size as the content. I am using a canvas as a background. Since i am making a j-query mobile, the content is not alot and the background goes below the footer and it looks a lot weird. Please suggest how can i fix it. Blow is the screen shot Thank you ![926a82d7e14f017a1eb399145032f98f](/attachments/small/3/926a82d7e14f017a1eb399145032f98f.jpg "align-left")

Member Avatar
Member Avatar
+0 forum 3

how in a canvas HTML5 I can add more than one image,... is any stack order? how many images overlap and seem all or part of them, can have in canvas? canvas or an image can saved in localStorage html5?

Member Avatar
Member Avatar
+0 forum 1

Hi, I have an IFrame. Good. And I have a Canvas as well. Good again! The user can write on the IFrame as I set the design mode ON. I am using document.execcomand to do the stuff, just like a simple text editor. I do not have issues on this. Here are my questions: 1/ What I want is, how to make the text written in the IFrame, appears on the Canvas? I mean, when the user is typing in the IFrame, the text is appearing simultaneously on the Canvas. If the user changes the text color, font color, bold, …

Member Avatar
Member Avatar
+0 forum 1

Hello everyone I created one canvas and draw one line on it I want to move this line using mouse on the canvas How to move line on canvas because using draggable function it cant move so pls help me.

Member Avatar
Member Avatar
+0 forum 2

My ultimate goal is to save rendered presentation MathML to a .PNG file. Knowing just enough about programming to be dangerous :-) there may be a better way to do this...I am drawing the equation on a canvas element, then trying to save the canvas element as a .PNG. I started with code found here -- https://developer.mozilla.org/en/HTML/Canvas/Drawing_DOM_objects_into_a_canvas -- and modified as follows: <!DOCTYPE html> <html> <body> <canvas id="canvas" style="border:2px solid black;" width="200" height="200"> </canvas> <script> var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var data = "<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'>" + "<foreignObject width='100%' height='100%'>" + "<div xmlns='http://www.w3.org/1998/Math/MathML' style='fontsize:40px'>" + "<math>" …

Member Avatar
Member Avatar
+0 forum 6

I want to create a java application where you can build simple logic circuits (just started learning java recently and it was just a random project idea I got off the net) Ultimately I want the gates as icons on a pane that users can drag and drop onto a canvas but drag and drop is a bit too far ahead for now. So I was thinking of a list next to a large white area (a panel or a canvas) and clicking on the canvas or panel should create a new instance of whatever is selected on the list. …

Member Avatar
Member Avatar
+0 forum 11

Hi, I have a usercontrol that is dynamically created on the canvas of my application. after a good amount of time over the net, i couldnt get the answer for the below. how do I align the usercontrol to the canvas left, center, top, bottom and right alignments on the canvas so that the user control moves on the radio button clicks of the user for alignment that i have given. thanks in advance.

Member Avatar
Member Avatar
+0 forum 1

Hey I have recently started to learn canvas in html5. As of now I can draw all the basic shapes rectangles arcs etc. I am also able to get the mouse coordinates and show them in a text box in the main body of the html. I am just wondering how do I implement the coordinates I got using clientX and clientY into my canvas script so I can draw freely?.

Member Avatar
Member Avatar
+0 forum 1

I have the following html file [CODE]<!DOCTYPE hmtl> <html> <head> <title> Minimum Spec Test </title> <script src="Compatability.js"></script> <script type="text/javascript"> var can, ctx; var img = new Image(); function Init() { can = document.getElementById('canvas'); can.width = 100; can.height = 400; ctx = can.getContext('2d'); img.src = 'Images/_test.bmp'; ctx.drawImage(img, 0, 0); } </script> </head> <body onLoad="Init()"> <canvas id="canvas" style="border:1px solid #c3c3c3;"> Your browser does not support the canvas tag. </canvas> </body> </html>[/CODE] Now this code works on ios safari 4.2 and later but i can't get it to work on ios safari 4.1. On 4.1 it displays the canvas but will not draw …

Member Avatar
Member Avatar
+0 forum 1

I need to save a video as an image in silverlight, for my new webpage functionality, at [url]http://www.game4tress.com/ecardsender.aspx[/url]. Now, this would be easy in WPF, but seems that silverlight can't access the RenderTargetBitmap and BitmapEncoder. I was able to discover that RenderTargetBitmap can be replaced with WriteableBitmap, but i can't replace BitmapEncoder. If the function was made in WPF, i would use this code: [code] myCanvas.HorizontalAlignment=HorizontalAlignment.Stretch; int Height=(int)myCanvas.ActualHeight; int Width=(int)myCanvas.ActualWidth; RenderTargetBitmap bmp=new RenderTargetBitmap(Width,Height,96,96,PixelFormats.Pbgra32); bmp.Render(myCanvas); BitmapEncoder encoder=new JpegBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(bmp)); using(System.IO.Stream stm=System.IO.File.Create("C:\\Temp.jpeg")) { encoder.Save(stm); stm.Dispose(); } [/code] I can't seem able to find an equivalent way out in Silverlight. Can you, please …

Member Avatar
+0 forum 0

The script is used in my newest chrome app [url]https://chrome.google.com/webstore/developer/detail/bomkcodcgmbjjhogdjophonfhgpegoni/[/url] Site: [url]http://codestrix.co.cc/pixels/[/url] The above script is a good to get stated with HTML5 canvas. Much of it is named so as to be self explanatory but any doubts you are more than welcome to post it here.

Member Avatar
Member Avatar
+1 forum 2

The End.