draw

Android save canvas screen as bitmap

浪尽此生 提交于 2019-12-11 02:19:06
问题 Is there a way to do it? I d like to save the canvas screen as a Bitmap object, and then draw it again, to the screen. 回答1: You can construct a Canvas passing in a Bitmap onto which the canvas will draw. See http://developer.android.com/reference/android/graphics/Canvas.html#Canvas(android.graphics.Bitmap) You need to construct a Bitmap appropriately sized to the view into which you want to draw. Just guessing here, but if you are doing this because you want to draw off screen then draw the

Processing 2.0 - Open file dialog

泄露秘密 提交于 2019-12-11 02:09:53
问题 my goal is to select a file from a "file open" dialog box, read it and draw objects based on the content of the file. I found a way to open that dialog box (see skeleton code below), however the PDE program starts drawing BEFORE I can select the file. As the drawing depends on the content of the selected file, I get a null pointer error. My question is how can I select the file before the draw method starts ? If I define my file (Amas.in) explicitely in setup(), all is well, the program shows

Draw Venn diagram using Java

China☆狼群 提交于 2019-12-11 01:42:00
问题 I'm trying to draw a Venn diagram from a given boolean equation e.g (a AND b) AND c I want to do this on an android phone so I need to find a way to do it using Java. I found a perfect widget that does everything I am looking for in this Boolean Algebra Calculator They create perfect diagrams, I am sure it's not using Java and neither could I see their logic. I would appreciate any API, algorithm or guidance. 回答1: It uses a WolframAlpha widget to generate the Venn diagram. Luckily for you,

OpenGL, OpenVG. Draw text?

一个人想着一个人 提交于 2019-12-11 01:17:29
问题 There are enough "examples" but all of them represent parts of strange code. The best code I found is: link but I can't even run it because it has variables and constants with missed declaration. Can anybody post a full workable example? 来源: https://stackoverflow.com/questions/20186811/opengl-openvg-draw-text

Android: can not get KML file to parse and then draw route on Map

早过忘川 提交于 2019-12-11 00:25:44
问题 I write an application that help people find appropriate places and show the direction to the target. Before, this functionality work well but now the draw route function does not work. The exception I got is that application can not download and then parse the kml corresponding to the route ( the code: xmlreader.parse(is); ), although the URL generated to get KML is correct (I test it in Browser) - for example: https://maps.google.com/maps?f=d&hl=en&saddr=21.04664,105.852203&daddr=21.040527

Offset when drawing on canvas

柔情痞子 提交于 2019-12-10 21:18:23
问题 Have a simple drawing application. The problem is in the coordinates ( redraw function): they must be mouse, but are near 2x mouse. What's the problem in the code? <html> <head> <style type="text/css" media="screen"> body{ background-color: green; } #workspace{ width: 700px; height:420px; margin: 40px auto 20px auto; border: black dashed 1px; } #canvas{ background: white; width: 100%; height: 100%; } </style> <script type="text/javascript" src="jquery-1.7.1.js"></script> <script type="text

Android LiveWallpaper: start rendering below notification bar

我怕爱的太早我们不能终老 提交于 2019-12-10 20:49:14
问题 I'm doing a Android LiveWallpaper with LibGDX and I want my application to start rendering below the notification bar, and not under it. In the picture: Left is what I get, right what I want. Any advice? Thanks 回答1: You could use this: Height of Android statusbar And simply draw under it. If you are using Worldunit based drawing (not Pixelbased) you can use this: Gdx.gl.glViewport(x, statusbar.height, width, height); To show you what this does look at this link: Keep aspect with black borders

how to use DrawFilter?

戏子无情 提交于 2019-12-10 20:21:19
问题 very little has been discussed about DrawFilter over the net, so i couldnt find a decent answer for the following question: it has been documanted here that: A DrawFilter subclass can be installed in a Canvas. When it is present, it can modify the paint that is used to draw (temporarily). With this, a filter can disable/enable antialiasing, or change the color for everything this is drawn. So i do want to use this feature in order to change the color things are drawn in my canvas to black,

JavaFX 2.x; Still problems with draw on chart + zoom

a 夏天 提交于 2019-12-10 18:13:28
问题 I am still struggling with this hard problem I can't solve: the code below performs a zoom (magnify) by left mouse click & drag on the chart (from up left to down right) and restore back form down right to up left. Right mouse click and drag performs a free hand draw: the problem is that if I draw then zoom, what drawn is displaced and it is not where I previously drawn. How to fix this? Thanks Here's the code: public class Zoom extends Application { Path path;//Add path for freehand

Using GraphicsMagick in Unity3D

大憨熊 提交于 2019-12-10 17:56:13
问题 I'm looking for an alternative to using the System.Drawing in Unity3D, since apparently Unity doesn't support it. I'd like to simply draw some lines on a texture. But I want options such as line width and edge rounding, which are fairly complex. GraphicsMagick seemed perfect, plus it's free. So here's the steps I've already taken: 1) I changed my playersettings to use api compatability level 2.0, not "subset". 2) I downloaded GraphicsMagick .Net 2.0 x64 wrapper, extracted the dll. 3) Right