draw

How to make a line draw between two points as you are trying to set the second / end point of the line (like drawing a line in MSPAINT!)

I was wondering if anyone would be able to tell me how you would go about this? e.g. - User pushes (+) Add Button - Image appears to let user set start point of line - After user sets the first point a second image appears and a line is drawn between them and animated between them as user moves the second image into place. You could s...

How do I draw a vermiculated line in Java?

I know how to draw straight lines but could I draw a line which http://img163.imageshack.us/img163/2320/path3003.png (around a straight line i.e.)? Excuse me, I do not speak English very well to describe this more detailed ;-) Edit: Hey sorry for my late answer - you are right, it should be something like a sine wave which "vericulates...

In Cocos2d/OpenGL-ES check pixel of previous draw ?

I'm drawing some lines in cocos2d (using handy ccDrawLine), nothing fancy, but i want to check if my animated line hits something. I could do some math calculations for some objects, but for some dynamic parts in the scene it would be much easier if i could do: if pixel not black at (x,y) // line will hit something do handleCollisi...

Drawing large graph with graphviz

Hello guys, I have here generated a large .dot file of my facebook friends' graph with fb-map. It has 287 nodes and almost 2000 edges. I'm using dot and neato to generate a .png image, using the overlap="orthoyx" paramethers, but it doesn't give a nice effect. Too many overlapped edges. Do you know any set of options to manage such hug...

Point symbols in R

There are 25 symbols defined by 'pch' paramter in the points function. How can I draw more than these 25 symbols Thanks ...

Android: custom button shape

I'm trying to achieve a custom controller containing of various buttons in different shapes. I'm wondering how I can achieve this with Android. The result should look similar like this, where every color is a different button. I suppose I have to subclass View so please don't write that as an answer ;-) Please give some methodical ste...

Android ItemizedOverlay draw method question

Does anybody know the relationship between the members of an Android Itemized Overlay list and when draw() is called. Specifically, I'm trying to find out if draw is called once for each Overlay or once only for the whole set. Thanks, R. ...

How to draw rounded raised and sunken edges of control?

I need a way to draw rounded raised and sunken corner edges on a custom control. Currently, I am using ControlPaint.DrawBorder3D, but of course the corners are squared off and looks terrible. How can this be done? Also, this project is not allowed to use any PInvoke calls. ...

[SOLVED][AS3] Draw shadow without filter on Graphics object.

I have a complex graphics data on a sprite or a shape (no matter which is exactly). But I want to draw shadow (inner too) for one Rect ( [10, 10, 240, 25] for example) or another path. /// code before grObj.graphics.drawRect( 10, 10, 240, 25); /// -> draw inner shadow on this objcect somehow /// code after Is it possible t...

To draw a vertical line in Android when a button is pressed?

Hi, I want to draw a straight vertical line on my Android activity, when a button is pressed. Please explain how I can draw the line with a position & length I want. Elaboration: I have a linear layout with vertical orientation. A set of buttons constitute this linear layout. When I press one button, I want a line to appear to the righ...

Android SurfaceHolder.unlockCanvasAndPost() does not cause redraw

I'm implementing a fairly standard app with the Android sdk that involves drawing using the SurfaceView, SurfaceHolder, Callback setup. In my main thread (UI thread) I have no drawing or handling of the SurfaceHolder (or the canvas you retrieve with it). In a separate thread I have the following: Log.i("GAME.DrawThread", "run()"); ...

draw track on mapview

I use following code to draw a track on the mapview, but i find that the bitmap only cache the mapview size. if some line outside the map. the bitmap will not cache. That make the track not complete. how can i solve that problem? Thank you `if ((bmap == null) || (lastZoom != mapv.getZoomLevel())) { Projection proj = mapv.getProject...

how to get coordinates of a polygon in OpenLayers

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 k...

Cartesian coordinates in Java

I'm trying to draw a function's curve, so I need a method to convert my curve points coordinates to screen coordinates but I can't get it to work. Here's the method I use to convert: public Point tradPoint(Point P){ Point Ptd = new Point(); Ptd.x=getWidth()/2 + P.x*getWidth()/20; Ptd.y=getHeight()/2 - P.y*getHeight()/20; ...

Android: looking for a drawArc() method with inner & outer radius

I have the following custom view: This I have achieved by using the Canvas' drawArc() method. However, with this drawArc() method I cannot limit the arc's inner radius. What I'd like to have is something like this: where there is only an outer ring left. What I need is an drawArc() function where I can set the inner radius of the...

IB builder or programmaticaly draw?

quick question to the gurus of coding! What do you advise? should i programmatically draw my textfields, labels, images or should i use IB? would it make any difference? i have scrolling issues (bit jerky) but not something i cannot live without! thanks EDIT: Please, Please gentleman.... get in line for your answers.... NOT all toge...

Let users draw a line (arrow) on a div/img

Using the jQuery plugin: imgareaselect (http://odyniec.net/projects/imgareaselect/), I let users select areas of an image to add comments (just like flickr). I'm aiming to let users draw arrows pointing on specific image areas instead of drawing boxes. Any idea if (and how) I can modify imgareaselect to draw lines (with an arrow head) i...

iPad (very) simple drawing

I'm trying to implement a very simple drawing view in my app. This is only a small part of my app but it's turning into a real hassle. This is what I have so far, but all it's displaying right now is morse code like dots and lines. - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor...

NetworkX node attribute drawing

Im using networkx for visualization. I see when I use the function draw_networkx_edge_labels I can retrieve the labels for edges. I want to print the attribute on node ( instead of the label).. try everything almost . still stuck. If i have 5 attributes per node, is there anyway I can print a specific attribute on each node ? For exam...

How to draw text at runtime

Basically, Im making a paint application very similar to MSPaint. The idea is that, that the the user clicks anywhere on the form and should be able to write text in a control. And then following that, that text should be displayed in g.drawstring graphic method. ...