draw

Get text of view (button)

◇◆丶佛笑我妖孽 提交于 2019-12-07 11:19:41
问题 I have two column in relative layout. both column have few button with text. I want to draw a line using finger which join the button. Take the example of "match the following" like A ------------------- A. Above things are done. Now i want to get the text of button from where user start drawing the line and end the line. In above case is "A". Could any one please help me out. I want to get the text with Orange circle when user start drawing the line from finger and then text of the green

Cache whats being draw on MapView in Android

て烟熏妆下的殇ゞ 提交于 2019-12-07 09:41:22
问题 I am developing an app for my Universities campus that displays the campus in a MapView; then using geopoints draws the outlines of the buildings on campus on the mapView using the draw method a class that extents Overlay. There are about 50-60 buildings being drawn, resulting in a very laggy map as the draw method constantly gets drawn over and over. I have looked into my problem and I have found some people mentioning drawing the buildings on a canvas, but I have found no good examples or

WebView doesn't get drawn, WARN/webcore(5336): Can't get the viewWidth after the first layout

假装没事ソ 提交于 2019-12-07 08:28:51
问题 My app has a view that gets added to activity programmatically using this code: RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(480, 75); RelativeLayout parent = (RelativeLayout)mMyView.getParent(); if (parent != null) { parent.removeView(mMyView); } activity.addContentView(mMyView, layoutParams);` After pressing the Back Button, which ofcourse calls OnDestroy(), and running the app again, I don't see the View get drawn on the screen, and I get this warning on DDMS

Can't draw() sprites in pyglet

喜你入骨 提交于 2019-12-07 07:13:33
问题 For some reason, I can't get pyglet to draw sprites. Here's my code: import pyglet game = pyglet.window.Window(640, 480, "I'm a window") batch = pyglet.graphics.Batch() pyglet.resource.path = ["."] pyglet.resource.reindex() image = pyglet.resource.image("hextile.png") pyglet.sprite.Sprite(image, x=200, y=300, batch=batch) pyglet.text.Label('DING', font_name='Arial', font_size=24, x=100, y=100, batch=batch) @game.event def on_draw(): game.clear() batch.draw() #image.blit(0, 0) pyglet.app.run()

Pygame: How to draw in non rectangle clipping area

会有一股神秘感。 提交于 2019-12-07 06:57:58
问题 Hi I would like to set in pygame non rectangle clipping area (in this case as character "P"), where it would be strict limited, where to draw another objects. Is there any option? thanks a lot 回答1: Let's see if I correctly understand your question: you want to "blit" an image onto a surface, but do it through a mask which would only allow certain pixels of the source to actually end up on the surface? I had this precise problem and at first I thought it would only be doable through PIL.

Point symbols in R

◇◆丶佛笑我妖孽 提交于 2019-12-07 06:18:13
问题 There are 25 symbols defined by 'pch' paramter in the points function. How can I draw more than these 25 symbols Thanks 回答1: You can see all the options for a given font using code like: plot( 0:15, 0:15, type='n' ) points( (0:255)%% 16, (0:255) %/% 16, pch=0:255, font=5 ) Change the font= to different numbers for different options. There are a couple more options using the symbols function. If you want even more then check out the my.symbols function in the TeachingDemos package (I am the

Load bitmap into canvas and draw over it

依然范特西╮ 提交于 2019-12-07 04:02:27
I like to make an app, something like a little paint, I have to get a bitmap, draw it on a canvas and next, draw over it (with figer)... So, I actually have this code: import java.io.File; import java.io.FileOutputStream; import java.util.ArrayList; import android.content.Context; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import android.os.Environment; import android.util.Log; import android.graphics.Bitmap; import android.view.MotionEvent; import android.view.View; import

Drawing fixed set of grid lines with OpenCV

倖福魔咒の 提交于 2019-12-07 00:30:16
问题 Is it possible to draw user-defined grid lines with defined points at all intersections, against the output of the color detection sample in the OpenCV sample file? Basically, the webcam will need to be detecting human head and shoulders from above you. Then when a person is detected, I need the grid lines to be there so that I am able to know from which outermost grid (left shoulder), to the next outermost grid (right shoulder), in both x and y axis (forehead and back of head). Thereafter,

Android draw text into rectangle on center and crop it if needed

£可爱£侵袭症+ 提交于 2019-12-06 19:50:19
问题 I want to draw text into rectangle on center (horizontally and vertically). If there is too much of a text that crop it what do not fit into rect. I have try to do it as this example show, but without luck. Any ideas? 回答1: Try this private void drawRectText(String text, Canvas canvas, Rect r) { textPaint.setTextSize(20); textPaint.setTextAlign(Align.CENTER); int width = r.width(); int numOfChars = textPaint.breakText(text,true,width,null); int start = (text.length()-numOfChars)/2; canvas

Coloring nodes with RGB pixel values in networkX.draw() : ValueError: c of shape (16, 3) not acceptable as a color sequence

天大地大妈咪最大 提交于 2019-12-06 15:55:20
l randomly generated a graph of 16 nodes. Each nodes take a clor : red,blue or green. Here is my code : G= nx.watts_strogatz_graph(16, 2, 0, seed=seed) color = ['red', 'blue', 'green'] x = G.nodes() l = len(x) color_gen = choices(color, k=l) node_positions = nx.spring_layout(G, scale=100) nx.draw(G, pos=node_positions, node_color=color_gen, with_labels=True) such that color_gen represents the color of each node : ['red', 'blue', 'blue', 'red', 'green', 'blue', 'green', 'blue', 'red', 'green', 'red', 'blue', 'red', 'green', 'green', 'green'] Now l would like to change the intensity of each