graphics

How to draw a single point with .Net?

Hello, this should be pretty simple but I don't get it. How can I draw a single point in .Net? If I use g.DrawLine(Black,0,0,0,0) nothing is drawn and if I use g.DrawLine(Black,0,0,1,0) a line with 2 dots is used. The same happens with g.DrawRectangle. This has me intrigued. Thanks in advance. EDIT: A box of 1x1 is a box of 4 pixels a...

alpha blending in gtk

How can you draw semi-transparent primitives such as filled polygons to a Drawable in GTK? Its 2010, and I google isn't finding how to put an alpha value into a colour for me. What am I missing? ...

Algorithm for Text Wrapping Within a Shape

I am looking for an algorithm to wrap text within a non-rectangular shape, preferably based on the Knuth and Plass algorithm. The hardest part of this is that the lines may have different heights due to differing font sizes in the text. The image below is an example of what the algorithm should be able to generate. Thanks for any hel...

Pretty Pixel-level Picture Painting, Programatically

My mac laptop has 1,024,000 pixels. What's the simplest way to turn my display completely black and go nuts with writing little programs to twiddle pixels to my heart's delight? To make it more concrete, say I wanted to implement the Chaos Game to draw a Sierpinski triangle, at the pixel level, with nothing else on the screen. What are ...

How to refresh screen so that closed forms actually disappear

I have multiple forms that popup during an intensive operation. For example, when a form popups asking user for something, and the user clicks OK, the form's graphics stay on the main screen, even though it is closed. How can I make it so that these graphics disappear completely? ...

How to get results efficiently out of an Octree/Quadtree?

I am working on a piece of 3D software that has sometimes has to perform intersections between massive numbers of curves (sometimes ~100,000). The most natural way to do this is to do an N^2 bounding box check, and then those curves whose bounding boxes overlap get intersected. I heard good things about octrees, so I decided to try impl...

3D bar chart on a map

Hi there, I need to generate a 3D bar chart and have the bars come out of a map of the countries. End result would look like this: http://dividedbytechnology.co.uk/impacts.html ...but with legible text. The text is not very legible here, or at its source page. Thanks. ...

iPhone - Drawing 2D Shapes

Hi guys! I have an array of 2D points which make an irregular polygon. What I want to do is draw the borders of it and then fill it with a color. I am using Cocos2d to code the game around, but I have not found a fill function in Cocos2d, only the ccDrawLine and such. Is there a simple way to draw filled shapes in Cocos2? I have ...

ActionScript Read Sprite's Graphics?

how can i retrieve the set graphics properties of a sprite? for example, in the code below, i'd like to get the color of the sprite, also it's rounded corners setting and other graphics attributes. var sp:Sprite = new Sprite(); sp.graphics.beginFill(0xFF0000, 0.75); sp.graphics.drawRoundRect(0, 0, 300, 50, 10, 10); sp.graphics.endFill(...

Getting Bounds of a specific Window

Hello, I have the following code : System.Drawing.Rectangle desktop_Rectangle = System.Windows.Forms.Screen.PrimaryScreen.Bounds which gives me the Bounds of the Desktop. I am now looking to get the Bounds of a specific Window using the caption of the Window. Do I have to use Interop in order to accomplish that ? any sample code w...

Finding the intersection of two vector equations.

I've been trying to solve this and I found an equation that gives the possibility of zero division errors. Not the best thing: v1 = (a,b) v2 = (c,d) d1 = (e,f) d2 = (h,i) l1: v1 + λd1 l2: v2 + µd2 Equation to find vector intersection of l1 and l2 programatically by re-arranging for lambda. (a,b) + λ(e,f) = (c,d) + µ(h,i) a + λe = c +...

Simulating brush strokes for painting application

I'm trying to write an application that can be used to create pictures that look like paintings using simulated brush strokes. Are there any good sources for simple ways of simulating brush strokes? For example, given a list of mouse positions that the user has dragged the mouse through, a brush width and a brush texture, how do I determ...

Double buffering C#

Hey, I'm trying to implement the following method: void Ball::DrawOn(Graphics g); The method should draw all previous locations(stored in a queue) of the ball and finally the current location. I don't know if that matters, but I print the previous locations using g.DrawEllipse(...) and the current location using g.FillEllipse(...). Th...

Video display with openGL

I want to display very high resolution video directly with OpenGL. The image data is going to be processed on the GPU and I want to avoid a round-trip back to the PC to show the video in a standard bitmap based window. Cross platform is nice, Windows only would be OK (so would nvidia only) Anyone have any links to ways doing this? ...

How can I parse through a texutre in DirectX? (IDirect3DTexture9*)

I've been trying to figure out how to parse textures in directx for two reasons: to write my own texture format and to manipulate data in existing IDirect3DTexture9 type textures. I've been looking at the IDirect3DTexture9::LockRect() function but I'm unsure how it works, are the void* pBits I get out of it in D3DLOCKED_RECT the data in...

Is OpenVG supported by video card vendors?

Hello all, Is OpenVG supported by nVidia, AMD and Intel in their drivers? Will it be supported in future? I'm really interested in some sort of HW-accelerated text and SVG rendering. Regards, ...

Source for iPhone graphics?

I have found several great sources for iPhone icons, but are there any "stock" graphics available (free or paid) for other UI elements? For instance, a UITableView skin, background images, or custom control artwork. ...

How to create iOS image buttons that scale well across multiple resolutions?

I've run into the issue of using a UIBarButtonItem with a custom color. Everything out on the 'net seems to indicate that the only way around this lack of official API support revolves around the use of images. This is all fine and dandy when developing for pre-iOS 4 devices, except when using the new iPhone 4. Creating an image for i...

Is triple buffering really a free performance boost?

So I've been reading a lot about openGL and gpus and graphics in general, and triple buffering is semi-frequently mentioned as giving a free performance boost. I know why it helps; in effect, you can do v-sync without being limited to a framerate choice of 60 or 30 or 20 or 15 or etc, so you can actually achieve, say, 55fps. But is there...

Which is the best GUI tool for J2ME apps

Hi all, I m doing a commercial j2me project in which I need some good Gui like tabbed pane and auto complete text boxes and I need a constant look and feel across all handsets so anyone having idea what gui tool used for commercial apps. I found j2me polish and LWUIT but I m confused which is preferred in j2me commercial apps. Regards ...