canvas

Custom views inside canvas android

霸气de小男生 提交于 2019-12-25 01:49:45
问题 I want to create a GUI in android where I want to achieve the following :- 1) Drag and connect components(image view) to an custom view. 2) While the connection has been achieved the component and the custom view has to be connected using a bezier curve. 3) When I move the connected component around (drag and move), the connected line should expand/contract accordingly. (ie, This cannot be a static image, it needs to be drawn.) Please provide me with some guidelines to achieve the same. The

Canvas to Save Image and Email

孤街醉人 提交于 2019-12-25 01:47:17
问题 We have a custom product designing tool at "http://dev.ejuicysolutions.com/custom_shirt_designer/". When user will be finished with formatting with text etc... they will click on print button, where they can print but we need to extend functionality from print to "Save Image, as shown in Canvas" and then email that image. Email can be done but the main problem we are facing is that image is being saved on server but all other formatting like text are not being saved along with. Either script

Android canvas drawText from right to left

天涯浪子 提交于 2019-12-25 01:46:34
问题 I have an app that handels Arabic too, but my Arabic users have a problem that the drawText flip the word .. Arabic must be from right to left. How do I make the canvas drawText from right to left? See in the picture the highlighted text is the right text its a textView and it's fine. But the canvas DrawText the one in a circle is wrong. It must be from right to left, how do I make the canvas drawText from right to left? 回答1: On the canvas just create two points on sides where you want to

embedding a matplotlib graph in a Tkinter canvas widget class

大憨熊 提交于 2019-12-25 01:42:08
问题 I am trying to create a Tkinter widget class that embeds a matplotlib graph in a canvas object. The code I have written almost works but doesn't seem to exit properly when the widget is closed. Here is the code I am using. This is not the actual matplotlib graph code I am using but something I wrote for the purpose of asking this question. My original matplotlib graph code is very long and is too impractical to try and copy for this post. from Tkinter import * import matplotlib matplotlib.use

Tile map collide not working as expected in Javascript

别来无恙 提交于 2019-12-25 01:30:01
问题 I have been thinking of a way to set-up tile map collision with a player in the same way I have developed the game so far (or similar way if possible, so I do not have to redo everything :) ). I got some ideas from tutorials and videos and decided to implement it to my code and the player definitely collides with something, though it doesn't look to be the correct tiles that it should be. For example I want it to walk on over the tiles with Index 1, but to collide with tiles with Index 0 and

how to zoom to triangle in canvas

我的未来我决定 提交于 2019-12-25 01:15:49
问题 Hey I have created a triangle in canvas, I have used 2 methods: main method: createTriangle which called to createInterval 3 times. The triangle is composed of 3 vertices only. Now I want to add zoom option to current canvas. Zoom In and Zoom out, but I don't know from where to start? The problen start from the fact that,I don't have any center point for current triangle and O don't know how to calculate it. Any guidance will be helpfull :). Update What about directives or libraries which can

creating a png from a part of html

梦想的初衷 提交于 2019-12-25 01:08:41
问题 I have a couple of input fields which will get populated by users. Additionally, I have a field that displays the current time and an image that gets chosen by the user. I packed everything in a <div id="container"> Now I want to save this div as a .png when the user hits a button. What's the best way to do this? I was thinking of drawing everything in canvas but I am not sure if that is possible or a good way. I tried this set up here Input form inside canvas element but the input is not

Canvas Impulse Animation Effect

允我心安 提交于 2019-12-25 01:07:58
问题 I'm studying the following canvas animation by Matei Copot. Can someone explain how the "impulse"/shooting effect works, and how, say I can simplify the code to only have 3 stationary dots a, b, and c (while showing the impulse effect between a-> b and between b -> c)? var w = c.width = window.innerWidth, h = c.height = window.innerHeight, ctx = c.getContext( '2d' ), opts = { range: 180, baseConnections: 3, addedConnections: 5, baseSize: 5, minSize: 1, dataToConnectionSize: .4, sizeMultiplier

Remove circle drawn in html5 canvas once user clicks on it

佐手、 提交于 2019-12-25 00:46:16
问题 I wrote a code that generates randomly 60 circles in a canvas, how do I handle that an event onclick circle pressed disappear and after is generated another? which may be the best solution? the code is: var canvas, ctx; var circles = []; var selectedCircle; var vel=200; function Circle(x, y, radius){ this.x = x; this.y = y; this.radius = radius; } function clear() { // clear canvas ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); } function drawCircle(ctx, x, y, radius) { var color =

HTML5 canvas how to give it a boundary?

跟風遠走 提交于 2019-12-25 00:28:53
问题 for a school assignment i am making a kite game.. i am a total javascript noob and i really need some help. so i am at the point that i have an image moving by pressing the arrow buttons. the problem now is that my image can go outside of the canvas and i want it not to.. i really have nooooo idea how to do this i have tried multiple tutorials but it doesnt seem to work. window.onload = function() { var canvas = document.getElementById("game"); window.addEventListener('keydown', keyDown, true