graphics

How to fill a Path in Android with a linear gradient?

Given a closed Path object result is like this: http://www.tutorialguide.net/images/adobe_photoshop/0043/001.jpg. Although that is a rectangle I'm looking for something which works with any closed Path. ...

Does computer graphics have a practic use besides games/movies/pictures ?

Hello, I am learning Computer Graphics at the university and I'm trying to figure out the use of it ... and I fail. Only games and movies stick in to my mind, I'm sure there are other uses for, let's say, graphic algorithms, openGL, 2D and 3D, 3ds Max ... Is it useful later on ? Where do I need it ? Thank you ...

Multiple GTK windows with Cairo graphics

I've got a GTK graphics window showing communcation between various devices, and I'd like to bring up another window giving more detail when the user clicks on one of the devices. I'm using pixbufs for the drawing, and the windows won't be modal. What's the simplest way to bring up more windows that can overlap and be moved around inde...

How to create plots in multiple windows and keep them seperate in R

Hello SOers, I'm sure this is an easy problem, but my google / help foo has failed me, so it's up to you. I have an R script that generates several plots, and I want to view all the plots on screen at once (in seperate windows), but I can't work out how to open multiple graphics windows. I'm using ggplot2, but I feel this is a more bas...

How to create an animated tiled background from a texture atlas with Cocos2d

I want to create a CCLayer with an animated tiled background from a larger texture atlas with Cocos2d. I know how to drop a background in a CCLayer. I know how to create an animated CCSprite. I even know how to handle tiled world maps. But I can't find a proper way to combine all these elements in the desired form. How would I do this?...

Java2d: Option to show a selection window when mouse is dragged.

Hi, I have a image in Java2d and I would like user to give an option to select any rectangle portion of the image by left clicking and dragging the mouse.(similar to mspaint). How is this actually done? Thank you. ...

Java2d: Increase the line width

Hi, I want to increase the Line2D width. I could not find any method to do that. Do I need to actually make a small rectangle for this purpose? Thank you. ...

Cloning ID3DXMesh with declration that has 12 floats breaks?

I have the following vertex declration: struct MESHVERTInstanced { float x, y, z; // Position float nx, ny, nz; // Normal float tu, tv; // Texcoord float idx; // index of the vertex! float tanx, tany, tanz; // The tangent const static D3DVERTEXELEMENT9 Decl[6]; static IDirect3DVertexD...

How to change the coordinate of a point that is inside a GraphicsPath?

Is there anyway to change the coordinates of some of the points within a GraphicsPath object while leaving the other points where they are? The GraphicsPath object that gets passed into my method will contain a mixture of polygons and lines. My method would want to look something like: void UpdateGraphicsPath(GraphicsPath gPath, Recta...

some links for graphics in C

hello to everyone, I'm looking for some tutorials which can teach about graphics on C, I tryed find it, but all I can find are discussions about special topics, I'm beginner, thanks in advance ...

iPhone Rendering Question

Hi all, I'm new to iPhone/Objective-C development. I "jumped the gun" and started reading and implementing some chapters from O'Reilly's iPhone Development. I was following the ebook's code exactly and my code was generating the following error: CGContextSetFillColorWithColor: invalid context CGContextFillRects: invalid context CGCont...

Java2d: Set gradient for a lines

Hi, I am having multiple points in a plane and some hundreds of lines pass through those points. Some points can have more lines passing through them than other points. I want to show some kind of more gradient or brightness associated with lines crowded together. Is this possible to do in java2d. Please refer to this : http://ft.ornl....

difference between SDL and GLUT

Hi, I am learning the Opengl graphic programming at Eclipse. Can someone tell me the difference between GLUT application and SDL application, so that I can dig into either one of them? Tks. ...

How do I visualize a complex graph in .Net?

I need to visualize a graph of this kind. I don't know how to name it (by the way, if you know - I'll appreciate if you tell me). It would be ideal for graph elements to be clickable (so that when user clicks on a block, I can handle an event with the element id specified) but I can survive even without any interactivity. I may like to b...

drawing arrows on a line defined by a set of points( for tracking)

Hi, I have a set of points which define a route and I must draw them so a vehicle's moving direction is denoted. The points may be from a curve and I need to draw some arrows. I want to draw arrows on the route to define which arrow vehicle goes. I have a mapviewr java applet and the last I must do is this work, I want to...

Weird shape resizing behavior in WPF

Hello, I am making a WPF application that will let the user draw and resize shapes. The resizing part is done using adorners, and the shapes are my own classes derived from Shape. For example I have a Polyline, and for each of it's points I am adorning a Thumb with a handler on it's DragDelta event: void Thumb_DragDelta(objec...

reverse formula conversion

Hi All! I have a formula which calculate position for Y, here it is: double y = ...; double minX = ..; double scaleY = ..; int MAX_COORD = (1 << 16) - 1; int sy = ~(int)((y - minY) / scaleY * MAX_COORD) & 0xFFFF; and now i have sy, and i need to calculate y like this: y = (sy * scaleY) / MAX_COORD + minY; but conversion is not equ...

Graphics Question: How do I restrict the mouse cursor to within a circle?

I'm playing with XNA. When I click the left mouse button, I record the X,Y co-ordinates. Keeping the mouse button held down, moving the mouse draws a line from this origin to the current mouse position. I've offset this into the middle of the window. Now, what I'd like to do is restrict the mouse cursor to within a circle (with a radius...

y-direction shearing matrix and its equivalence

Hello every one I want to know how rotation and scaling equivalent y-direction shearing matrix? 1 0 0 shx 1 -shy.xref 0 0 1 I understood what shearing mean but how can get it using rotation and scaling ?? thank you :) ...

How to prevent overdrawing?

This is a difficult question to search in Google since it has other meaning in finance. Of course, what I mean here is "Drawing" as in .. computer graphics.. not money.. I am interested in preventing overdrawing for both 3D Drawing and 2D Drawing. (should I make them into two different questions?) I realize that this might be a very b...