drawing

spring like drawing in c#

旧巷老猫 提交于 2019-12-11 05:56:39
问题 How to draw the spring like shape using c# drawing class alt text http://img812.imageshack.us/img812/373/spring.jpg 回答1: This is more of a math problem than a C# one. What you want is to derive a Parametric equation for the curve you wish to draw. With that go and fill an array of Point objects with values for the parametric equation on a certain interval with a certain step (the smaller the step the more the final drawing will look like the actual shape). Then you can use g.DrawLines (MSDN:

Suggestion for implementing a drawing program - UML designer

不羁岁月 提交于 2019-12-11 05:28:08
问题 This program will have an infinite canvas (ie as long as the user scrolls, it becomes bigger) with a tiled background image, and you can drag and drop blocks and draw arrows between blocks. Obviously I won't use a layout manager for placing blocks and lines, since they will be absolutely positioned (any link on this, possibily with a snapping feature?). The problem arises with blocks and lines. Basically I'll have two options: Using a simple layout for each building block. This is the

Dynamic Results and Covering Data

五迷三道 提交于 2019-12-11 04:41:19
问题 Today I have a question that sprouted off of this one: Database Results in Cocoa. It's regarding using the data that was returned by a database to create a certain number of questions. I am using a form of the following code (this was posted in the question). NSMutableDictionary * interfaceElements = [[NSMutableDictionary alloc] init]; for (NSInteger i = 0; i < numberOfTextFields; ++i) { //this is just to make a frame that's indented 10px //and has 10px between it and the previous NSTextField

Draw points and lines in gnuplot

≯℡__Kan透↙ 提交于 2019-12-11 04:23:59
问题 How is it possible with gnuplot to plot both isolated points and lines for the same input file? I mean, once I have a file data.dat of this kind that defines two lines 1-2 and 3-4 x1 y1 x2 y2 x3 y3 x4 y4 I can plot the lines with $> plot 'data.dat' w lp but if I want to also add some isolated points to be displayed with gnuplot I would like to add to my data.dat file the following x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 x7 y7 obviously the points 5,6,7 are treated by gnuplot as points of a line.

drawing random circles, storing their coorindates in an array

北慕城南 提交于 2019-12-11 04:02:40
问题 For homework I want to draw circles randomly around the screen. If any of the circles overlap, then I want to fill in those circles. I am starting with some code that draws circles on the screen wherever the mouse pointer is clicked. I am really confused about how to use random values to determine the circles and also how to store those values in an array or an arraylist. I think that to fill in the circles I will just use an for statement comparing the distance between centerpoints of

Making graphviz trees have parents centred above children

依然范特西╮ 提交于 2019-12-11 03:56:48
问题 I have the following graphviz code: graph { node[width = 0.6, height = 0.6, fixedsize=true, shape=circle]; a[label="22"]; b[label="22"]; c[label="34"]; d[label="22"]; e[label="99"]; f[label="34"]; g[label="40"]; h[label="37"]; i[label="22"]; j[label="99"]; k[label="135"]; l[label="129"]; m[label="40"]; edge[penwidth=3.0]; a -- b; b -- d; c -- f; d -- i; e -- j; g -- m; edge[penwidth=1.0]; a -- c; b -- e; c -- g; d -- h; e -- k; g -- l; } This is meant to draw a binary tree with some edges

How do I call the Pie function?

匆匆过客 提交于 2019-12-11 03:53:18
问题 I have the center point, radius, and angle to draw the pie, but the Pie function takes 4 points as input data. Does anyone have any conversion function or better explanation for this? 回答1: The four points in the pie function: Upper left corner of the bounding rectangle. Lower right corner of the bounding rectangle. Point on the circle that marks the beginning of the pie. Point on the circle that marks the end of the pie (counter clockwise). Conversion: Centerpoint: Cx, Cy Radius: r Angle: a

Drawline offset at both ends

允我心安 提交于 2019-12-11 03:36:24
问题 I am trying to draw dotted lines using the DrawLine method. However, it adds a slight offset to the ends which makes the lines ugly. How can prevent adding offset to the ends? protected override void OnPaint (PaintEventArgs e) { Graphics g = e.Graphics; g.DrawLine (Dot, new Point (10, 50), new Point (70, 50)); g.DrawLine (Dot, new Point (70, 50), new Point (70, 100)); } Pen Dot = new Pen (Brushes.Black, 2) { DashStyle = DashStyle.Dot }; Output Intended Result 回答1: The goal is simple and

“Drawing” an arc in discrete x-y steps

六眼飞鱼酱① 提交于 2019-12-11 03:31:05
问题 What's the best way to draw an arc using only x-y position movements? For example let's say I want to draw a circle with radius 4 at point (4,4). Let's saw my "drawer" starts at (4,0) and a resolution of .1 steps in each direction. How would I create a sequence of movements to complete the circle? If that's not clear I can try to explain better. 回答1: If I understand your question properly, you are looking for Bresenham's algorithm. You can read about it here, for example. 回答2: You want the

How to hide the symbol number on PowerDesigner?

守給你的承諾、 提交于 2019-12-11 03:21:26
问题 In Sybase PowerDesigner, when designing an UML diagram that takes 2 copies/instances of the same XXXX object (ie. objects), the application adds a number identifier like "XXXX : 2" to that symbol. Is it possible to remove it? Thanks in advance! 回答1: It does not seem to be directly doable. However, (somewhat tested with 16.0), you can add an Extension to your model, define a computed attribute (type String) on your object type, returning the object name: %Get% = obj.name and use Tools >