draw

how to get coordinates of a polygon in OpenLayers

廉价感情. 提交于 2019-11-30 07:22:27
I have been looking for how to determine coordinates of the points which consist a polygon(feature) in OpenLayers. Let's say I have created a polygon like the one in this example. I need to know the points which consist the polygon, so I can save them somewhere. I bet it is an easy one. I just couldn't find anything, probably I don't know what I should search for. Thanks in advance. Found it finally! vectors.features[0].geometry.getVertices() 来源: https://stackoverflow.com/questions/3836676/how-to-get-coordinates-of-a-polygon-in-openlayers

PHP Application Flow Graph (or function call graph)

北战南征 提交于 2019-11-30 07:08:04
Happens that I've ended up working on a big PHP program and I need a program (or easy to install script) which draws a flow control/call graph of a PHP application (ie; must work over multiple PHP files). Already saw stuff like Graphviz, not sure which one works for PHP? Any suggestions? Cheers! Pascal MARTIN I have never used any tool that can do that statically (i.e. from source files) , but here's a way to get a callgraph when executing a script/application. First, you need to install the Xdebug extension -- on a development/testing server (don't install it on a production server : it's

Draw lines between 2 elements in html page

喜你入骨 提交于 2019-11-30 06:28:46
i need to draw lines between 2 element on html page the results should be like this: http://img2.timg.co.il/forums/1_173873919.JPG i wondered what the best way do this using canvas and html5 using background image. make by ajax dynamic the image i would like to know what the best way and if there is a simple demo on the web thanks Lots of ways to solve your need: Here's one solution using an html canvas: http://jsfiddle.net/m1erickson/86f4C/ Example code (could be fully automated with jquery+css-classes): <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" media="all" href=

android - adding a String over a Drawable image?

这一生的挚爱 提交于 2019-11-30 05:43:37
I'm trying to add a String to a Drawable image. I'm currently not using a Panel to draw and I'd like to keep it that way. Any ideas or do I need to invoke an onDraw() method? My image is showing up with this code: Drawable image = getResources().getDrawable(tile_types[tileType]); setImageDrawable(image); I'd like to add a String over this image. Thanks. Sam's answer was my starting point, but the image didn't show up, only the text (I use it on a Google Map). Finally I got it working with a LayerDrawable . Here is my solution: private Drawable createMarkerIcon(Drawable backgroundImage, String

New to Android - Drawing a view at runtime

馋奶兔 提交于 2019-11-30 05:08:58
问题 HI all, I'm just getting started with developing for Android. I'm looking to port one of my iPhone applications, but I'm kind of at a loss for how to draw a view at runtime (a view not declared in the XML). Basically, I want to draw a simple rectangle, but then be able to manipulate its frame after being drawn. Sorry if this is a really, really simple question, but I can't seem to find some equivalent to the iPhone SDK here. Thanks in advance! 回答1: It sounds like you want to experiment with

How to resize and draw an image using wxpython?

爷,独闯天下 提交于 2019-11-30 05:08:30
I want to load an image, resize it to a given size and after draw it in a specific position in a panel. All this using wxpython. How can I do it? Thanks in advance! wx.Image has a Scale method that will do the resizing. The rest is normal wx coding. Here's a complete example for you. import wx def scale_bitmap(bitmap, width, height): image = wx.ImageFromBitmap(bitmap) image = image.Scale(width, height, wx.IMAGE_QUALITY_HIGH) result = wx.BitmapFromImage(image) return result class Panel(wx.Panel): def __init__(self, parent, path): super(Panel, self).__init__(parent, -1) bitmap = wx.Bitmap(path)

Drawing a filled circle or rectangle inside a DataGridViewCell in C# Winforms

回眸只為那壹抹淺笑 提交于 2019-11-30 03:20:36
问题 I want to draw a small filled circle in the center of a DataGridViewCell . A rectangle can do the trick as well. I assume I must do it in the CellPainting event. I have tried this: if (e.RowIndex >= 0 && e.ColumnIndex >= 0) { if (dgv_Cuotas.Columns[e.ColumnIndex].Name == "Seleccionar" && Convert.ToBoolean(dgv_Cuotas.Rows[e.RowIndex].Cells["pagada"].Value) == true) { e.CellStyle.BackColor = Color.LightGray; ; e.PaintBackground(e.ClipBounds, true); e.Handled = true; } } Its painting the whole

HTML Canvas - Draw curved arrows

a 夏天 提交于 2019-11-30 03:09:26
问题 I'm trying to draw curved arrows in a html canvas. I have no problem to draw a curved line but I don't know how to put the > at the end of the line (direction). ctx.beginPath(); ctx.fillStyle = "rgba(55, 217, 56,"+ opacity +")"; ctx.moveTo(this.fromX,this.fromY); ctx.quadraticCurveTo(this.controlX, this.controlY, this.toX, this.toY); ctx.stroke(); My idea is taking a small part of the line at the end and draw a triangle. How can I get the coordinate of a point in the line? Below is the image

How to draw a rectangle around a region of interest in python

冷暖自知 提交于 2019-11-29 22:09:47
I'm having trouble with import cv in my python code. My issue is I need to draw a rectangle around regions of interest in an image. How can this be done in python? I'm doing object detection and would like to draw a rectangle around the objects I believe I've found in the image. please don't try with the old cv module, use cv2: import cv2 cv2.rectangle(img, (x1, y1), (x2, y2), (255,0,0), 2) x1,y1 ------ | | | | | | --------x2,y2 [edit] to append the follow-up questions below: cv2.imwrite("my.png",img) cv2.imshow("lalala", img) k = cv2.waitKey(0) # 0==wait forever You can use cv2.rectangle() :

How to make any view to draw to canvas?

陌路散爱 提交于 2019-11-29 19:44:23
I have a short question: Suppose I have a (mutable) bitmap that I need to modify (add images, texts, etc...) . Instead of messing around with many special classes for drawing to the canvas (paint, canvas, matrices and so on), I was thinking why not use the built in classes of Android for this task and only if i need really customized operations i could still use the canvas ? So, for example, in order to show any kind of view (that has no parent, of course) on the bitmap, I could call the next function : public void drawViewToBitmap(Bitmap b, View v, Rect rect) { Canvas c = new Canvas(b); // <=