draw

finding route directions from source to destinaton in android

守給你的承諾、 提交于 2019-12-09 22:04:14
问题 I am new to android, i have managed to write code that displays the google map, i can able to give source and destination addresses and place push pin over there using reverse Geocode concept... the scenario is i want to display the driving,walking,bicycling directions from source to destination point with displaying a line from source to destination.. 回答1: AFAIK there is no route calculation functionality in Google Maps for Android. Furthermore, live route calculations for navigation are not

pil draw text with different colors

陌路散爱 提交于 2019-12-09 17:46:20
问题 Hi to draw three different text with different options for ex: text-number-1 , font=arial, color=red text-number-2 , font=veranda, color=blue, size=30 text-number-3 , font=tahoma, color=green, size=40 , align=center text must go in new lines. def pil_image(request): text = request.GET.get('text', None) font = str(request.GET.get('font', 'arial')) fontsize = int(request.GET.get('fontsize', '20')) textcolor = str(request.GET.get('textcolor', '000')) import Image, ImageDraw, ImageFont, textwrap

Draw rectangles, circles or arbitrary polygons in a m x n matrix

断了今生、忘了曾经 提交于 2019-12-09 08:49:08
问题 I want to simulate the flow around objects in two dimensions. Therefore I wrote a program in C which uses the Navier-Stokes equations to describe the motion of fluids. Now I came to the point where I actually want more than just placing a rectangle in the simulation domain. To draw such a rectangle I just do something like: for(int i=start_x; i<end_x; i++) for(int j=start_y; j<end_y; j++) M[i][j] = 1; // barrier cell = 1 Doing this I get a nice rectangle. No surprise. But what would be an

Draw Bitmap in Custom ImageView and get the Co-ordinates of the ImageView irrespective of the device

拈花ヽ惹草 提交于 2019-12-09 06:21:53
问题 I want to get the co-ordinates of the ImageView , Irrespective of device size. Is there any possible way !! I have tried to create specific size for the ImageView ,Even specific size for the Parent View also ,but its not working. I have tried the following possible ways. int[] posXY = new int[2]; imageview.getLocationOnScreen(posXY); int MoveX = posXY[0]; int MoveY = posXY[1]; I have tried with Matrix too ,But not working. Matrix m = imageview.getImageMatrix(); Tried the below code, but it is

Is there an SDK to draw lines on iOS with touch?

白昼怎懂夜的黑 提交于 2019-12-09 06:15:27
问题 Is there a framework I can use to draw lines with touch. Basically I want to add ability for a customer to sign on iPad/iPhone and capture it as an image. Any help much appreciated. Thanks. 回答1: you can meet your requirement by using core graphics available in UIKIT framework. i had a similar requirement in my application with a different use ,if needed i can provide you the code. TNQ .h file #import <UIKit/UIKit.h> typedef enum _DrawingMode{ DrawingModePen =0, DrawingModeEraser=1, }

How do you make NLTK draw() trees that are inline in iPython/Jupyter

六月ゝ 毕业季﹏ 提交于 2019-12-08 19:14:25
问题 For Matplotlib plots in iPython/Jupyter you can make the notebook plot plots inline with %matplotlib inline How can one do the same for NLTK draw() for trees? Here is the documentation http://www.nltk.org/api/nltk.draw.html 回答1: Based on this answer: import os from IPython.display import Image, display from nltk.draw import TreeWidget from nltk.draw.util import CanvasFrame def jupyter_draw_nltk_tree(tree): cf = CanvasFrame() tc = TreeWidget(cf.canvas(), tree) tc['node_font'] = 'arial 13 bold'

Cant Change UIView Background Color From Black

徘徊边缘 提交于 2019-12-08 19:13:41
问题 This is my first time in which I've encountered problems with drawRect. I have a simple UIView subclass with a path to fill. Everything is fine. The path gets filled properly, but the background remains black no matter what. What should I do? My code is listed below: var color: UIColor = UIColor.red {didSet{setNeedsDisplay()}} private var spaceshipBezierPath: UIBezierPath{ let path = UIBezierPath() let roomFromTop: CGFloat = 10 let roomFromCenter: CGFloat = 7 path.move(to: CGPoint(x: bounds

Creating Image from View

ⅰ亾dé卋堺 提交于 2019-12-08 13:56:03
问题 I am creating an image from a view in android and adding another image to the bottom of it with the code below CardView card_view = (CardView) tmps.findViewById(R.id.card_view); Bitmap b = Bitmap.createBitmap(card_view.getWidth(), card_view.getHeight() + 112, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); card_view.draw(c); c.translate(card_view.getWidth() / 2 - 51, card_view.getHeight() + 10); Drawable d = context.getResources().getDrawable(R.drawable.share_logo); d.setBounds(0, 0, d

Android draw with finger over webView

自古美人都是妖i 提交于 2019-12-08 11:15:04
问题 How can I draw over a webView, I want a user to be able to circle and doodle over the webview. The gestureoverlayview would be good, but the drawn line will always disappear after the user takes their finger off the screen. I would like the user to be able to draw on the screen and keep the drawn lines there when the finger is lifted off. Many thanks 回答1: You can stack a WebView underneath a Canvas of some sort that allows the user to paint on it with touch inside of a RelativeLayout. To

dynamically Change Itemized overlay draw circle using seek bar progress

不羁岁月 提交于 2019-12-08 10:20:48
问题 i m maikng an app using Maps. I m drawing circle on a specific point using itemized overlay and it works pretty fine. But i want to change the radius of that circle with the seekbar progress value. Can any body guide me to this Thanks in advance. 回答1: To Draw the Circle with on map We have to use itemozied Overlay But to change it with the Progress of Seek Bar We need to do the Following thing that will work with Seek Bar and also if you want to set the zoom level using seek bar It is handled