graphics

Creating image or graphic in C# from decimal data?

Is it possible to create an image or graphic using vector data that has decimal components that vary? And, of course, if its possible... then how? For example: a vector has two points where point one is {9.56, 4.1} and point two is {3.456789,2.12345}. Note: the precision varies from number to number. ...

Combining graphics with a user interface in Java

Hey guys I've got a nice text based java program that I'd like to add a GUI to. I have dabbled with Netbeans and shouldn't have too much of a problem getting the components in place. However, the program will have to dynamically update images within the interface window, and I'm not sure what the best way to go about doing it is. Ar...

Moving Shapes With Mouse using GLUT

Hello, We are new to OpenGL and GLUT programming and our teacher gave us a homework. The task is, there are 3 rectangles and 1 triangle. Each object have a different color (for easy selection) With these objects, we are suppose to do a home building. I drew the objects but I have big problems with moving. The first method and the easies...

Source code for Xiaolin Wu's line algorithm in C?

Hi, I'm looking for a nice and efficient implementation of Xiaolin Wu's anti-aliased line drawing algorithm in C, does anyone have this code they could share with me? Thanks ...

mouseover banner controlled by text

I'm trying to create an effect where rolling the mouse over some text will cause an image in another part of the page to change to another image until you the mouse moves away from the text. Does anyone know of a simple way to do this? I'd prefer using CSS only, but will use js if it is necessary. ...

How can I multiply an image against the alpha of another image in Cocoa?

Having loaded two different images I want to do the following operation and obtain image3. image1.red * image2.alpha = image3.red image1.green * image2.alpha = image3.green image1.blue * image2.alpha = image3.blue I wrote the code in the link below for Android and was basically looking for the same functionality in Objective-C/Cocoa. ...

How do I start doing diagram development in c#

I'd like to try to create a diagram making tool (something like entity-relation diagram you can create in SQL Server 2005, or class diagrams you can do in Microsoft Visual Studio) Ie. I'd like to create boxes, put text in them, be able to edit this text and draw lines between boxes. I never did this kind of programming before so I do...

Best dynamic languages for OpenGL/general graphics

Which are the most mature and well supported solutions for writing graphical programs? I have been using C++ with OpenGL/GLUT, but would like to try a more flexible and expressive approach. Ruby and Processing? Python and OGRE? What things have worked well for you? ...

Blackberry - Small Up Down Arrow Button

i want to create 2 buttons for blackberry which look like this... and the second one inverted of the above i wanted to do this without using images (for efficiency) and the buttons should appear only when there is focus on them and dis sapper when focus goes off.. ...

2D rendering with per-pixel lighting/normal map - directX

hiya. I'm looking for the simplest, easiest and fastest technique to render 2D textured quads with per-pixel normals. what i mean is a 3D world where the camera is fixed and all the texture quads are facing to the same direction (the camera), and between them there will be light points, and i want the textures to have per-pixel normal va...

.net graphics.drawstring non-letter characters

I am experiencing an issue where the string drawn on an image is putting non-letter characters in the wrong place, i.e. Hello World! draws on the jpg !Hello World anyone else seen this? ...

How to prevent InvalidOperationException when using System.Drawing.Graphics?

I am using the System.Drawing.Graphics.DrawLines(Pen pen, PointF[] points) method in a multithreaded application, but the System.Drawing.Graphics isn't shared between threads. Why it keeps throwing the System.InvalidOperationException: The object is currently in use elsewhere ? ...

What kind of cool graphics algorithms can I implement?

I'm going to program a fancy (animated) about-box for an app I'm working on. Since this is where programmers are often allowed to shine and play with code, I'm eager to find out what kind of cool algorithms the community has implemented. The algorithms can be animated fractals, sine blobs, flames, smoke, particle systems etc. However...

Should a person new to windowed applications study X, GTK+, or what?

Let's say the factors for valuing a choice are the library of widgets available, the slope of the learning curve, and the degree of portability (platforms it works on). As far a language binding goes, I'm using C++. Thanks! ...

Simple C++ Graphics Library

Any suggestions for a simple C++ library I can use to create an image to a specified size, with either a fixed rgb colour value or ideally supporting gradients. Needs to work on Windows and ideally but not required to work on OS X as well. I've found Cairo, but just wondered if there was anything else as it seems quite simple what I re...

Efficent use of OnPaint

I am programming in Visual Studio .Net and using C#. I am creating my own control that draws a wave based on values I get from an analog to digital converter (ADC). I take the incoming points and convert them into X and Y points to properly draw the graph in my control. I have a loop inside my OnPaint method that goes through all the ...

Can't draw on Internet Explorer

I have the following code which draws a square on the main window of another process: private void DrawOnWindow(string processname) { IntPtr winhandle = GetWindowHandle(processname); Graphics grph = Graphics.FromHwnd(winhandle); grph.DrawRectangle(Pens.Red, 10, 10, 100, 100); } private IntPtr GetWindowHandle(string windowNa...

maximum height-based Graphics::MeasureString?

hi all how could one write a version of Graphics::MeasureString(String, Font, Int32) that takes a maximum height instead of width? the reason behind this question is that i have a label that i would like to resize to a specific height, and have the contained text automatically re-flow to take up as little horizontal space (there is a m...

Java VolatileImage - validate() vs contentsLost()

When using VolatileImage to do accerlerated Java2D operations, how do you properly use the methods validate(GraphicsConfiguration) and contentsLost() to ensure that nothing goes wrong. When do you call which method? ...

design exercise preferably using mfc

i was told to design a paintbrush program in 2 variation , one that uses lots of space and little cpu and the other vice versa. the idea (as i was told- so not sure) is somehow to save the screen snapshots versus saving XOR maps (which i have no idea what it means) who represent the delta between the painting. can someone suggest a wa...