graphics

How can a programmatically draw a scalable, aethetically-pleasing, curved comic-book balloon tail?

As a UI specialist, I am often asked to build tool-tip displays and other sorts of popups that display text. One of styles clients seem most keen on is text in a comic-book balloon. I would like to create this balloons programmatically (as opposed to embedding or linking to rendered graphics), because these balloons will have to change s...

Is there a technique for re anti-aliasing an image to a different background color?

Is there a programmatic approach for drawing an anti-aliased image on a new background color / pattern that would re-anti-alias the image to the new background color? Preferably accessible to a .Net program? ...

How can I install aggdraw after this error?

I am trying to install the aggdraw python library to create high quality graphics but I keep getting this error: agg22/include/agg_array.h: In member function `agg::int8u* What is the workaround for this? How can I install it? ...

How to plot two equidistant moving points?

Imagine a surface which has got 2 points which are moving over the surface (resulting into various lines and curves) while adhering to the following conditions. These two points are always and always at a constant C distance from each other. Each point has it's own velocity and direction vector. Of course both these parameters will be...

How would I create a web based dynamic mind mapping application in Javascript?

I am trying to create a type of mind mapping software that runs on the web, and I am trying to figure out where to start. I would like this to be able to be used by the most number of people possible. My web application is currently written using Javascript for the front end and C# for the back-end. I was thinking of using Javascrip...

Java - Draw a ruler (line with tick marks at 90 degree angle)

Hello all, I'm using Java AWT to draw lines on a panel (Line2D & and Graphics2D.drawLine) and I'm wondering how I can draw a line with tick marks, similar to: |----|----|----|----|----| I know the positions I'd like to draw the ticks at in advance. The lines could be in any position, so the ticks must be drawn at an angle releative t...

Java AWT - Draw a Polygon connected by smooth curved lines

Here I am asking more silly graphics questions. Hopefully soon I will leave the world of graphics behind and plant myself firmly in the color-less middle-tier again. I have a newfound respect for people who are able to fiddle with images in pleasing ways through code. That said, I am drawing a Polygon on a canvas. It can have an arbitra...

Turn square image into round rect button with shine [Objective C]

In this picture you will see several TV show images that have been put into a rounded rect button with the same gloss/shine that an iphone app button usually has. In one of the icons you even see a ribbon saying "On air". I'm wondering; how do you replicate this effect? My guess is the programmer masked an image on top of the square...

Rotated 2d rectangle intersecting points or area

Moving ahead from previous question.I have two rectangle and they look like this: struct Rect { NSPoint topLeft; NSPoint topRight; NSPoint bottomLeft; NSPoint bottomRight; } I use something similar code to check whether rectangles intersects(or collision) . In case If 2 rectangles intersects I want to calculate the area of in...

PrintDocument_PrintPage & Graphics.DrawImage size in inches

I'm trying to print an image sized 2x2 inches. Created a conversion function (inches to pixels) based on the resolution. However, the result is far from 2x2 inch, printing produces image that barely fits the whole sheet! Am I'm doing something wrong? Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.D...

rotation of 2d shape clockwise direction

I am new to python and graphics but have programmed before. According to http://en.wikipedia.org/wiki/Transformation_matrix#Rotation , For rotation by an angle θ anticlockwise about the origin, the functional form is x' = xcosθ − ysinθ and y' = xsinθ + ycosθ But the following python code rotates it in the clockwise direction....

How does this work?

In applications like Adobe Illustrator, they have a way to simplify a path. I'm not sure how this works exactly. Given a path with points which have 2 bezier handles each (for cubic bezier), how could I go about simplifying the path? Thanks ...

Noise effect on Android background

Hello, A lot of new Android applications I've been seeing are using a noise effect on their backgrounds, usually a gradient. What interesting is that some applications use radiel gradients throughout their application with this effect, which would require a lot of disk space for the images. Now Android has GradientDrawable which can cre...

Simplifying a cubic bezier path?

I'm trying to achieve something close to what Adobe Illustrator does with the brush tool. It correctly analyzes and simplifies the path, including its bezier handles. I implemented the Ramer–Douglas–Peucker_algorithm however, it wound up not really being what I needed. It works very well for line segments, but doesn't factor in bezier ha...

iPhone/iPod coregraphics speed

Hi, I'm writing a piece of software for the iPhone/iPod. I've tested it on the simulator and lately using my first gen. iPod touch. To my surprise the code is a bit sluggish on the iPod device. My program (using core graphics) draws a large background image, a couple of other images, a large radial gradient fill, uses transparency (alp...

What would this look like as pseudocode?

I'm trying to implement this: from https://docs.google.com/viewer?url=http://www.tinaja.com/glib/bezdist.pdf&pli=1 The following BASIC program uses the method of finding distance. The program also searches for the minimum squared distance between points and a curve. REM BEZIER.BAS JIM 20DEC92 12:37 DATA 2,3,5,8,8,14,11,17,14,17,16,...

C# Graphics.DrawString not rendering special characters?

I'm trying to write some arbitrary text to a custom control.My code works, but when I try to draw characters such as ü, it displays an empty square where the character would be.I need this to work as I intend to support localizations.I have checked already, and Tahoma has the required characters. My code is below: string _Label = "Zurüc...

MFC: Drawing lines of different colors

I have two series of N points I want to graph in two different colors. I can't find anything that explicitly states the best way to go about this simple task when using MFC CDC and CPen objects, and as bunch of CDC::MoveTo/CDC::LineTo calls. It seems each device context can only have one pen object selected at a time, so am I best to se...

easy graphic for C++

What is the easiest framework/IDE fulfilling all following criteria? If such thing does not exist, what is the nearest? compiles C++ installs in full without problems runs under Windows or Linux (1 of those is enough) allows to write text to terminal and simultaneously draw graphics Hello World is short, about 10 lines for code drawing...

In computer graphics, what's the difference between a UVW mapping and a UV mapping?

In working with textures, does "UVW mapping" mean the same thing as "UV mapping"? If so why are there two terms, and what is the "W"? If not, what's the difference between them? [Wikipedia currently isn't illuminating on this question: http://en.wikipedia.org/wiki/Talk:UVW_mapping] ...