drawing

Hiding/Removing/Fading CALayer erasing NSView contents

My situation: I have a single window with a content view (NSView), which has several subviews (plain NSControl subclasses; not important, just for testing) scattered around it. For part of the end effect I am trying to achieve, I want to place a semi-transparent black CALayer overlaying the whole window's content view, and be able to m...

How to rotate a list of strings along an axis?

Hi, I have a list of strings which I paint on an axis. I want to rotate the strings (again, they should stay on the same horizontal axis when rotated). I am trying to use the following code: namespace DrawString { struct StringData { public string StringName; public int X; public int Y; } public...

drawRect function hindering performance

I am working on drawing a snake which moves using a CADisplayLink using DrawRect. The problem is when the snake is small the speed is fine, but when the snake grows in length the snake becomes really slow. I keep track of the snake using the followig variables: - variable to keep track of snakes head - variable to keep track of snakes ...

Software other than paint to create parsetrees automagic

I have a BNF grammar, and quite a few expressions that I am suppose to parse in regard to the grammar. Does it exists some software that I can enter the trees using ( ) to express the tree and than the software draws them? ...

Why can a control draw outside its bounding box?

Here's an example image of what I mean: example The gray rectangle is the bounding box of a control that draws the blue lines and dots in it's OnRender(...) method. The red ovals mark places where it happens. Why is that possible? How can it be avoided? ...

[AS3] curveTo finding the curve point dynamically

Hi Everybody, My math knowledge has never been very broad, so this maybe a simple question but I'm not really sure. Basically I'm using the curveTo function to draw some lines for flight paths, what I'm not sure how to do is dynamically finding the curve points, so for example if you look at the ryan air site: http://www.ryanair.com/en/...

Making a circle out of . (periods)

I am trying to make a function that will draw a circle out of periods with only being given a starting x and y and a radius. Is it possible? I would like to have the full code for it will an explanation for how it works; I've been trying this for 1 year now and I still can't fathom how it may be done. ...

Draw round-corner box

Hi, In my application I have a map, this map has a lot of annotations... but sometimes no location is found for an annotation (server couldn't find lat/lon). When this happens, I would like to draw a little box on my map with the text "Some locations could not be found" (or similar). I want this box to have round corners and to be trans...

Drawing a system-like cursor, top-most, anywhere

I need to draw a system-like cursor that I simply can control the position of. In other words, I need to draw a transparent image that looks just like the system cursor and I need it to be rendered on top of all other windows. I've tried multiple approaches, but they all seem to have some downside. I've figured out that I can load the c...

Drawing on Video within C#

Hi, I am making an application that will allow users to apply certain tools to analyse videos & images. I need help with how i actaully draw/write on the video loaded into windows media player within my form and being able to save it on. It needs to be able to lert the user draw freehand and shapes on it. Thanks in Advance, Chris :) ...

How can I efficiently draw thousands of particles? (C++ / OpenGL)

I'm currently writing an interactive simulator which displays the evolution of a system of particles. I'm developing on Windows 7 32-bit, using Visual Studio. Currently, I have a function to draw all the particles on screen that looks something like this: void Simulator::draw() { glColor4f(255, 255, 255, 0); glBegin(); for ...

HTML5 - best way to render an elliptic arc

I'm using HTML 5 to render elliptic pie charts per section; using a path that starts from the centre, out to the edge, across it's arc and back to the centre which is then filled. If they were perfectly circular I could use the arc or arcTo path functions, but because they're elliptical the outer curves will always have a variable radiu...

iPhone UIStringDrawing usage

Could someone please explain to me how to draw a string using UIStringDrawing instead of using a label? here is my code but for some reason it compiles and the screen is blank... // // MainViewController.m // DotH // #define WINDOW_FRAME [[UIScreen mainScreen] bounds] #define SCREEN_FRAME [UIScreen mainScreen].applicationFrame #defin...

drawing shapes & Buttons

The learning curve for iPhone development has been less steep than I expected. After following some tutorials and the excellent book "Beginning iPhone 3 Development" by Apress things have gone quite ok. And of course when I got stuck this forum has been a great help so far. Until now I never did any 'graphical' programming on any platfor...

Drawing, and Appending to a Double-Horizontal Line

Hello, I know how to draw straight lines in C#, but I would like to draw a horizontal line, with two colors. Light blue on the top, and dark blue on the bottom. Also, how would I sort of... Append to that line? For example, every few seconds, that line will become bigger... like a ProgressBar. (btw, I'm not creating a ProgressBar, just ...

Drawing arrows on bing maps in Silverlight

I need to draw lines to demonstrate transportation of goods on bing maps. To clarify start- and end-point, I draw a little arrowhead on the destination side. Problem is, when I view the global map, certain lines are drawn along the shortest path 'around the back'. For example going from New York City to Tokio, it would be drawn across th...

I am not able to draw shapes except for random lines onthe canvas. What will be the code for other options eg any line, rectangle or a triangle?

<script type="text/javascript"> var canvas, context, tool, e; var varblurup=0; var varsizeup=1; var swtchclr; // Keep everything in anonymous function, called on window load. if(window.addEventListener) { window.addEventListener('load', function () { //check tool is pen or line or shape var chktool="pen"; function in...

Matplotlib draw boxes

Hi, I have a set of data, where each value has a (x, y) coordinate. Different values can have the same coordinate. And I want to draw them in a rectangular collection of boxes. For example, if I have the data: A -> (0, 0) B -> (0, 1) C -> (1, 2) D -> (0, 1) I want to get the following drawing: 0 1 2 +++++++++++++ 0 + A + ...

Drawing within C# within a Picturebox

Hi, I want to be able to allow users of my program to click on a button, for example, a button for freehand rectangles to be drawn onto a picturebox. I need code for allowing me to first draw on the picturebox, and secondly for all the shapes that can possibly be drawn free hand in c#, e.g. line, ellipse, freehand drawing, text. Thanks...

Rapid Java Shape Manipulation

My team is short on time in implementing a simple shape editor. We have to be able to create, delete, move, and copy simple shapes like rectangles and lines. This has to be a stand-alone application (may not use applets). We've fully implemented our model underpinning the application, as well as the controllers. Any advice? Edit: This i...