graphics

c#: Choosing or modifying a control to create draggable graphics on a canvas

I'm attempting to write a small app that will do something similar to what is shown here: http://www.soccertutor.com/tour/MASTER_SKIN_team.swf However I've not used WPF/Win Forms very much at all and can't seem to find a control that will be most applicable to the situation. I want to have some sort of grid for the pitch so I can have ...

Public domain web template/graphics for developers?

This is an issue for web developers that aren't or don't have artists. We would really like some nice templates that we can modify for use on Intranet sites. So does anyone have suggestions for public domain web template/graphics for developers? ...

Non axis-aligned rectangle intersection

I'm trying to find an algorithm that will compute the intersection between 2 rectangles, which are not necessarily axis-aligned, and return the resulting intersection. This question describes finding whether an intersection exists. I'd like to have the resulting shape of the intersection, if it exists. My application of the algorithm w...

OpenGL in my HWND

Right now, I'm trying to port a Direct3D renderer from my engine. I'm and OpenGL begginer so i dont have much knowlegde about OpenGL, as now i can create windows and do my render via glut, but i can't use glut for my project, because the HWND is created in my code and then sent to the renderer DLL // Where pWindow is already a valid HWN...

glPushName() and GL_TRIANGLE_STRIP

Hi! I am trying to implement selecting a node in a terrain (represented by triangle strips). However I cannot use glPushName() between glBegin/glEnd, so I can only save the whole strip in a name buffer. Any other ideas how could I select a specific node/triangle with the mouse? I know that by creating GL_TRIANGLE objects instead of the...

Creating a composite Shape in Java 2D

Using Java 2D I've patched several Bezier curves (CubicCurve2D) together to create a "blob". The problem I now face is how to: Efficiently fill the blob with a given colour. Efficiently determine whether a given point lies inside the blob. I noticed thst CubicCurve2D implements Shape which provides numerous contains methods for dete...

C# Drawing, Strange Behaviour

Hi, the following code is fairly straight forward - it fills a design surface with randomnly selected pixels - nothing special (ignore the XXXXXXX's in the 2nd method for now). private void PaintBackground() { Random rnd = new Random(); Bitmap b = new Bitmap(this.Width, this.Height); for (int vertical = 0; vertical < this.H...

Java - drawing many images with Graphics.drawImage() and 2-screen buffer strategy distorts and cuts images.

I am using a loop to invoke double buffering painting. This, together with overriding my only Panel's repaint method, is designed to pass complete control of repaint to my loop and only render when it necessary (i.e. some change was made in the GUI). This is my rendering routine: Log.write("renderer painting"); setNeedsRender...

Is there a way to customize UITableView's separator line graphics?

I'm finding customizing UITableView's separator line graphics. It's basically a single line and it can be hidden. But I cannot know how to draw separator with my own custom graphics or image. Is there a regular way to do this? Or do I have to draw all myself and manage them manually? ...

OpenGL: Calculating z-value for 1:1 pixel ratio

Hi folks, I have a 256x256 texture in my view frustum that I need to move to a z-position where the texture is replicated on-screen at ACTUAL size. What I have so far is: const float zForTrueScale = -((itemSize/2) / tanf(DEGREES_TO_RADIANS(fieldOfView/2)) ) * 2; where itemSize is the size of my texture in world space (2.0 u...

Java 2D Shading / Filling

I have created a "blob" from Bezier curves (screenshot below) and would now like to shade it in such a way that it appears pseudo-3D, with darker shading on all "left" edges and lighter on all "right" edges, and perhaps pure white "light spots" on the surface itself. For example: I'd be interested in how to achieve the shading used in t...

Java and GraphicsMagick -- Will it work?

I am considering using GraphicsMagick (http://www.graphicsmagick.org/) in a Java project. Does anyone have any experience with this? Suggestions on how to get started? It seems like there isn't a native Java library so it may be a little more difficult. Thanks! ...

Converting Xaml Paths to AI or an open standard vector path

I have a xaml path that needs to be converted to AI or some other form of vector graphics such as a fireworks format where the paths can be edited. This is the xaml: <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Layer_1" Width="80" Height="50" Ca...

How to implement a gradient color picker in code?

I'm wanting to program something like Photoshop's gradient color picker. I've been googling but can't find anything. Do you guys know how to do it? ...

Raster graphics in xterm?

No, not ASCII graphics, see the screenshot here: http://en.wikipedia.org/wiki/W3m How is that even possible? I checked the source and it only prints character sequences. However, I am unable to find any reference to graphic drawing or image embedding escape sequences in xterm documentation or elsewhere. w3m also seems to be the only ...

problem with TextRenderer.MeasureText

Hi I am using TextRenderer.MeasureText() method to measure the text width for a given font. I use Arial Unicode MS font for measuring the width, which is a Unicode font containing characters for all languages. The method returns different widths on different servers. Both machines have Windows 2003, and .net 3.5 SP1 installed. Here is t...

UIView & Graphics Context

The UIView class does not set a graphics context, so when I go to get the current context, it comes back as nil. I'm in a method subclassed off of UIView, how may I get the graphics context to be able to simply draw a line? Very new at the x-code game. Any help would be appreciated. ...

Simpliest ancestor for a clickable, hand-drawn component?

I am creating a component that will be a large plus or a large minus. I don't want to use a bitmap because even I can draw this using the Graphics class, but the component must be clickable (the Shape class is not). It will be part of an item renderer, so I want it to be as light-weight as possible. UIComponent does not seem to sent CLI...

Convex hull of 4 points.

I would like an algorithm to calculate the convex hull of 4 2D points. I have looked at the algorithms for the generalized problem, but I wonder if there is a simple solution for 4 points. I've been scratching around on paper trying to figure out an algorithm but am having no luck at the moment. Thanks. ...

How to setup Quaternion to move point to particular location?

Hello i've been working on this seemingly simple issue for more than 2 days. I would love it if you would help me out. I have some code to produce a list of vectors (19) (thisPose ArrayList) corresponding to a pose for a skeleton: private ArrayList updatePose ( int poseIndex , ArrayList listOfUpdates ) { int i; ...