graphics

Are there any .NET Graphics Calculate Libraries?

Sorry for my bad English. I want to find a Calculate Library not a Drawing Library to help me do some graphics calulation like Bezier's length, point on Beziers or other metadata. Is there any library like this? ...

How to create a repeating background with xaml elements in silverlight?

I want to create an area in my application that looks draggable. Usually, you see this done with a background of small dots or squares, or sometimes lines. I'm using Silverlight and I want to simply create a background that is a set of repeating small rectangles. I honestly cannot figure out how to generate a background with xaml. I'...

Calculating Screen Space Error

I'm currently working on a Level of detail system for an XNA game, the system subdivides triangles with high screen space error and merges triangles with low screen space error. World Space Error is a heuristic which estimates the error that this triangle has, so for example if there is a triangle which is on an almost flat surface, it'...

How do I stop a System::Windows::Forms::UserControl from erasing it's background?

I have a C++/CLI System::Windows::Forms::UserControl derived control which should only redraw (a small portion of) itself as new data is fed into it. For some reason though, the OnPaint mechanism is being called even when there's nothing to cause it external to the app. Here's a snippet: void Spectrogram::OnPaint(System::Windows::Forms...

How do I calculate a four colour gradient?

If I have four colours (A, B, C & D) on four corners of a square and I want to fill that square with a gradient that blends nicely between the four colours how would I calculate the colour of the point E? The closer E is to any of the other points, the strong that colour should affect the result. Any idea how to do that? Speed and sim...

Drawing Colors in a picturebox?

In C# i have a picturebox. i would like to draw 4 colors. The default will be white, red, green, blue. How do i draw these 4 colors stritched in this picbox? or should i have 4 picbox? in that case how do i set the rgb color? ...

Rotating 3D cube perspective problem

Hi, Since I was 13 and playing around with AMOS 3D I've been wanting to learn how to code 3D graphics. Now, 10 years later, I finally think I have have accumulated enough maths to give it a go. I have followed various tutorials, and defined screenX (and screenY, equivalently) as screenX = (pointX * cameraX) / distance (Plus offsets ...

What typeset programming languages exist?

Mathematica's notebook front end has provided a hugely productive next-generation development environment for over 13 years, particularly suited to technical computing but also more widely applicable. What other languages have IDEs that allow code to be typeset and have inline graphics? ...

Windowsforms: How to draw lines/bars on a DataGridView?

I'm using a DataGridView in a Windows application (.NET 3.5) showing some colored bars (basically "tasks in time"): What I need now is, to show a custom graphical "completed" bar on the cells depending on a percentage value. Here is a photoshopped image: Any hint how I could approach the problem or a creative solution? Thanks! Ed...

Java Image Editor which renders output as source code?

Alex explained what I'm looking for much better than I have: You want an existing program that allows you to draw a picture, captures what you do as you draw, and writes each action as a Java command. When you click the "Drawl Oval" tool and click at 0,0 and then at 50,50, it would generate the line g.drawOval(0,0,50,50...

How do I get all the shader constants (uniforms) from a ID3DXEffect?

I'm creating an effect using hr = D3DXCreateEffectFromFile( g_D3D_Device, shaderPath.c_str(), macros, NULL, 0, NULL, &pEffect, &pBufferErrors ); I would like to get all the uniforms that this shader is using. In OpenGL I used glGetActiveUniform and glGetUniformLocation to...

Java AffineTransform moving origin

I would like to move the origin from top left to bottom middle of the component? I have been playing with AffineTransform class could not get it to work? ...

Using Graphics Card instead of GDI+ for Image Manipulation

I have a question, which may be a pipe-dream, but I wanted to know if any of my fellow Stack Overflow'ers could help me with. In the company I work for, we do billions of image manipulations each month. Basically, we take a massive image, slice it into 256 pixels square images, color quantize them and save them as pngs - and move onto ...

How to draw on top of winforms controls with transparency?

I have an app with a bunch of controls in it and I want to place a set of cross hairs on top of it. My first attack used a PictureBox and ran into this problem. The solution that fellow proposes, seems a bit... verbose for what I need. Is there a simple way draw on top of my form? Note that I don't even need the drawing to be part of a ...

Transformation (rotation) of image using matrix - design-time vs. run-time rendering results

Hi, I have a 48x48 image which is rotated using a transformation matrix. For some reason, the rotated image in design-time differs from the rotated image in run-time as you can see from this screenshot (design-time on the left, run-time on the right): It might be a little bit difficult to spot, but if you look closely at the right e...

Planning a 2D tile engine - Performance concerns

As the title says, I'm fleshing out a design for a 2D platformer engine. It's still in the design stage, but I'm worried that I'll be running into issues with the renderer, and I want to avoid them if they will be a concern. I'm using SDL for my base library, and the game will be set up to use a single large array of Uint16 to hold the...

Is there a nine-patch loader for iPhone?

Android has a nice way of defining stretchable images called a nine-patch. See these docs for a description of the concept. The idea is to surround a png image with a 1-pixel border where you can define the stretchable areas and the padding dimensions of the image. This is absolutely brilliant and I'd like to use the idea in my iPhone...

Raster graphics or vector graphics, which to choose for web-site development/designing?

While looking for a good tool for web-site development/designing on linux, I in the end got stuck with what to choose, the raster graphics or vector graphics. Gimp/Photoshop -- if you prefer Raster graphics (bitmaps i think) Inkscape/Fireworks -- if you prefer vector graphics (svg i think) I am totally inexperienced in this domai...

Smallest set of rectangles describing a set of integer points

Given a set of N-dimensional integer points how do I find the smallest set of N-dimensional cuboids (rectangles in the 2-d case), such that an integer point is in the set of integer points if and only if it's contained in one or more of the cuboids/rectangles. Integer point means a point with integer coordinates. e.g. given the points (...

Obtain a CGContextRef of NSView outside of drawRect ?

I need to get CGContextRef of NSView object. It won't be so bad if I knew how. In Carbon this thing was done like this: CGContextRef cgref = (libvlc_drawable_t)GetWindowPort(HIViewGetWindow((OpaqueControlRef*)hiViewRef)); Obviously it can be done by subclassing NSView (or it's subclass) and catching it in it's drawRect, but that's to...