draw

Draw a rectangular over an image by code

末鹿安然 提交于 2019-12-06 15:53:42
问题 I have this xml : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/photo0" android:id="@+id/imagBackground"> <TextView android:layout_width="20dip" android:layout_height="20dip" android:layout_marginLeft="250dip" android:layout_marginTop="15dip" android:background="#FFFFFF" android:id="@+id/index" android:text="0" android:textColor="

How to draw line between two nodes placed in different Panes / Regions

一笑奈何 提交于 2019-12-06 13:55:30
I am tryin to draw a genealogy tree. In my tree, I store information about ex partners. So the Panel (Region) for person shoud looking like this Z * * * Z * * * Z * * * X --- Y Where Z represent exPartner, X represent Persion and Y represent current Wife / Husband And now I would like to draw line to connect current relation with children. And ec relations with children. (graphicaly there will be a line beetwen Z and *) But when the person is in the other region LayoutX and LayoutX property return relative value. How Can I do that, and how dynamicaly resize this Panel ? I would like that Z

How can i draw in picturebox a polygon which is marked on the edges

泄露秘密 提交于 2019-12-06 09:54:04
i tried in that way but i didnt get the needed results: System.Drawing.Point[] p = new System.Drawing.Point[6]; p[0].X = 0; p[0].Y = 0; p[1].X = 53; p[1].Y = 111; p[2].X = 114; p[2].Y = 86; p[3].X = 34; p[3].Y = 34; p[4].X = 165; p[4].Y = 7; g = PictureBox1.CreateGraphics(); g.DrawPolygon(pen1, p); what i want to do is to draw a polygon in picturebox which is defined with diffrent colors and according to the rates (the number of corner and coordinates of the edges ) Create an xOffset variable, set it to be 30, and add that to every X value. Let yOffset equal 50 and add it to all your Ys.

Draw multiple times from a single bitmap on a canvas

女生的网名这么多〃 提交于 2019-12-06 08:38:04
问题 Basically I have the following bitmap: Bitmap cloud; cloud = BitmapFactory.decodeResource(getResources(), R.drawable.cloud); What I want to do is draw the same bitmap(in this case cloud) multiple times in different(random) locations on canvas. I want to do this in the OnDraw method of my view. So the final product should look like this: However This is the code for drawing the bitmap multiple times on the same canvas: protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub

Drawing area at Google Map

[亡魂溺海] 提交于 2019-12-06 07:36:34
问题 Please see the image : alt text http://img.skitch.com/20091211-bybjj3qtasrgr1dfaf4c42p39b.jpg Any idea how to do that? drawing an area. 回答1: The toolkit that allows users to draw polygons on MyMaps has been made available as the GeometryControls utility library 回答2: If you're looking to use Google Maps API, check the documentation about Polylines (should be what that is) : http://code.google.com/intl/pt-PT/apis/maps/documentation/overlays.html#Polylines_Overview 回答3: You need to instantiate a

iOS- How to paint in the within limits

本小妞迷上赌 提交于 2019-12-06 06:38:13
问题 I used the scanning line seed filling algorithm to realize the color filling function. But I don't know how to do that. When my pen lands in the flower, I need to draw only Inside the black edge of the flower,do not draw in the hair. I have tried to use : CALayer *layer = [CALayer layer]; layer.contents = (__bridge id)(image.CGImage); self.drawView.layer.mask = layer; But the plan didn't work. if any one gives solution it would be so great,Thank you. (English is not my native language; please

Android - User paints lines with their finger

不想你离开。 提交于 2019-12-06 04:39:47
I want to build a tool on Android where the user can paint some simple objects over a picture (eg line, circle or arrow). I started trying the line part first, and indeed I could succeed on painting it. The logic is that the user taps at one point and then drags their finger, painting the line. I use a class like this (it is based on DonGru's answer here ): public class DrawView extends View { Paint paint = new Paint(); float Sx, Sy, Lx, Ly; public DrawView(Context context, float x1, float y1, float x2, float y2) { super(context); paint.setColor(Color.RED); Sx=x1; Sy=y1; Lx=x2; Ly=y2; }

How to optimize draw area in pixel art editor

倾然丶 夕夏残阳落幕 提交于 2019-12-06 02:56:17
I have pixel art creator program, and I have rectangles on canvas that are one field (pixel?). And this is good solution on not huge amount of it (for example 128x128). if i want to create 1024x1024 rectangles on canvas this process is very long, ram usage is about 1-2 gb and after that program runs very slowly. How to optimize this, or create better solution? Using a Rectangle to represent each pixel is the wrong way to do this. As a FrameworkElement , every rectangle participates in layout and input hit testing. That approach is too heavy weight to be scalable. Abandon it now . I would

Drawing on top of an image in Javascript

核能气质少年 提交于 2019-12-06 02:55:39
问题 I want to let the user draw on an image in a browser. In other words, I need both bitmapped graphics and drawing capabilities, whether vector or bitmapped. Canvas looks good, but is not supported by IE, and though there is ExCanvas, I wonder if ExCanvas is stable enough for consistent use in IE6 through 8. Or best of all, is there an open-source image/drawing library that supports all this out of the box? I found two dozen or so Web-based image editors or drawing tools, but none support the

Creating a 2D polygon in XNA

寵の児 提交于 2019-12-06 01:49:41
问题 I have some sort of a problem. I'm new to XNA and want to draw a polygon shape that looks something like this (In the end, I want these point to be random): So I read some articles and this is what I ended up with: private VertexPositionColor[] vertices; public TextureClass() { setupVertices(); } public override void Render(SpriteBatch spriteBatch) { Texture2D texture = createTexture(spriteBatch); spriteBatch.Draw(texture, new Rectangle((int)vertices[0].Position.X, (int)vertices[0].Position.Y