drawing

How to draw hypergraphs?

I've searched for a long time a program that could draw hypergraphs, I've onl found the (marvelous) dot program on linux that can draw graphs. Anyone knows an equvalent for hypergraphs? ...

How to change x,y origin of canvas to bottom left and flip the y coordinates?

I have a bunch of data points that I would like to two-way bind to points on a canvas. The points assume larger y values are reflected in an upwards direction like most math graphs. How do I change the x,y origin of the canvas to the bottom left corner and reverse it's interpretation of the y coordinate? (I would like to stay in XAML)...

Cross-platform drawing library

I've been looking for a good cross-platform 2D drawing library that can be called from C++ and can be used to draw some fairly simple geometry; lines, rectangles, circles, and text (horizontal and vertical) for some charts, and save the output to PNG. I think a commercial package would be preferable over open source because we would pre...

Drawing coloured boxes with ncurses

Hi I want to draw a filled box in console and set colour for every single pixel. Is it possible to achive this with ncurses? If not - is there any other library that will do the trick? ...

pygtk: Draw lines onto a gtk.gdk.Pixbuf

I'm using pygtk with PIL. I've already figured out a way to convert PIL Images to gtk.gdk.Pixbufs. What I do to display the pixbuf is I create a gtk.gdk.Image, and then use img.set_from_pixbuf. I now want to draw a few lines onto this image. Apparently I need a Drawable to do that. I've started looking through the docs but already I have...

How to draw and fill a rounded rectangle in Rebol

How would you draw a Rounded Rectangle in Rebol and fill it with a gradient color ? Can't find any example. Thanks. ...

Why it does not draw circle ? (iPhone)

Hello there, i'm very new to iPhone sdk, mac os, xcode and etc. So don't take my question too hard. What i'm trying to do is figure out how can I draw an circle on the screen. (I know how to put image and move it, this is what my source does). Can you please explain me how can I draw simple shapes on that screen ? :) P.S. and Also...

Curvilinear perspective: Convert 3D to 2D

Hi all, I'm looking for the mathematical expression converting a 3D coordinate (x0,y0,z0) to a 2D (x1,y1) coordinate in a curvilinear perspective of radius R where the values of x1 and y1 are the angles of views {-90° .. +90°} of the original point. (image via http://www.ntua.gr/arch/geometry/mbk/histor.htm ) Thanks ! ...

C#: Paint own Bar Chart

Hello, I'm trying to paint a simple bar chart via C# but I've never experimented with the Graphics and Drawing namespaces. I thought of generating a "start" and "end" graphic and then repeating an image somehow (to show a "length") but I have no idea how to do this. I'd be really happy if you can point me in the right direction and/or ...

Simple iPhone drawing app with Quartz 2D

I am making a simple iPhone drawing program as a personal side-project. I capture touches event in a subclassed UIView and render the actual stuff to a seperate CGLayer. After each render, I call [self setNeedsLayout] and in the drawRect: method I draw the CGLayer to the screen context. This all works great and performs decently for d...

What are the indicator functions and constraints for complex grid drawing problems?

If you're looking at an array of pixels, in either 0,1,2,3, or even N dimensions, it's easy to tell if a certain pixel falls on a square or rectangular grid line within it by using an indicator function like so (I'll use imperative pseudocode to make what I'm talking about clear but I'm really only interested in the constraints and the c...

Dynamic Results and Covering Data

Hi Everyone: Today I have a question that sprouted off of this one: http://stackoverflow.com/questions/1082840/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...

GDI+ book from 2001: outdated or still relevant?

I'm trying to learn GDI+ (in C#). CodeProject has this article which is a free chapter from the 2001 WROX book Professional C#. Is this still an advisable way to learn GDI+ or is a more modern resource preferable? If the latter, what would be such a resource? ...

iPhone Development - Basic drawing and animation question

Hi all, I have a case where i'm drawing shapes, e.g. a Triangle (Points A, B, C). Now i want to animate it so that Points A, B, C move towards Point X, Y, Z. (Lets just say on button click) I'm using a drawRect: method in my custom view for drawing. I don't want my view to move, i rather want my drawing to move (because i have multiple...

Is there an optimal way to render images in cocoa? Im using setNeedsDisplay.

Currently, any time I manually move a UIImage (via handling the touchesMoved event) the last thing I call in that event is [self setNeedsDisplay], which effectively redraws the entire view. My images are also being animated, so every time a frame of animation changes, i have to call setNeedsDisplay. I find this to be horrific since I d...

Drawing braces with Pyx

How can I draw a “braced” line between two arbitrary points with Pyx? It would look something like this: ...

Draw a Sine Wave Between Two Arbitrary Points in Actionscript 3

Drawing "flat" waves is easy, but I want to draw the wave between two points x1,y1 x2,y2 Here is the "flat" code: package display { import flash.display.Sprite; import flash.events.Event; public class SineWave extends Sprite { private var angle:Number = 0; private var centerY:Number = 200; private var ra...

Drawing on Java heavyweight swing components

I'm working with an application in which I add a heavyweight (Canvas) to a JFrame. The Canvas is a 3rd party component, so I am required to keep it heavyweight. I'd like to add capabilities for the user to draw on the canvas and paint a selection rectangle. I don't think I can do this with the glass pane since the heavyweight canvas wil...

iPhone drawRect re-use for drawing in view

I have created a view and would like to draw or add text to it later based on the state of app when user touches it. Can I do this with drawRect given that I have multiple possible draw/text items for it? If so, how do you invoke it? If not, where should I look to accomplish this? Thanks in advance, Steve ...

Conditions when drawRect's rect != self.frame

I have a UIView subclass that I am doing some custom drawing in. When drawRect:(CGRect)rect is getting called rect.size is either (64, 63) or (63, 64); self.frame.size is (64, 64). I have multiple instances of this subclass, most of which get the expected (64, 64) size for the drawRect parameter. What are conditions that may cause some...