graphics

Java : VolatileImage slower than BufferedImage.

I'm making a game in java and in used BufferedImages to render content to the screen. I had performance issues on low end machines where the game is supposed to run, so I switched to VolatileImage which are normally faster. Except they actually slow the whole thing down. The images are created with GraphicsConfiguration.createCompatible...

Modifying and Manipulating a interactive bezier curve

This is a homework question and I'm having a lot of trouble with it - I've managed to do some of it but still cant finish it - can i Please get some help. Q1. Bezier Curves The following example allows you to interactively control a bezier curve by dragging the control points Cubic.java Replace the call to draw the cubic shape (big.dr...

Constructing colours for maximum contrast

I want to draw some items on screen, each item is in one of N sets. The number of sets changes all the time, so I need to calculate N different colours which are as different as possible (to make it easy to identify what is in which set). So, for example with N = 2 my results would be black and white. With three I guess I would get all ...

VB6 Game Development

I am developing a game in VB6 (plz don't ask me why :) ). The storyboard is ready and a rough implementation is underway. I am following a "pure-software-rendering" approach. (i.e. no DirectX, no openGL etc.) Amongst many others, the following "serious" problems exist: 2D alpha transparency reqd. to implement overlays. Parallax imple...

Draw a semicircle / half circle in WPF / C#

Hello, I need to draw a semicircle / half circle in WPF. Any idea how to do that? Thanks for any hint! ...

scenegraphs for c#

Hi, Are there any scenegraph based 3D engines (for OpenGL or DirectX) that I could use directly in my c# code ? Thank you ...

is there a way to change the text's font in Cimg?

hi!i wanted to know if i can draw a text in Cimg graphic library draw_text function and change the font of the text to another font ? ...

How do I pick the control point when using CGContextAddCurveToPoint to make a line graph with curves

I'm making a line graph on the iphone using core graphics and instead of having a jagged chart, I want to smooth it out like in good old math class. What's the formula to pick where to put the control points for CGContextAddCurveToPoint? CGFloat cp2x = (x + x + prevX); CGFloat cp1y = (prevY + prevY + y); CGF...

OpenGL: How to draw Bezier curve of degree higher then 8?

I am trying to draw high order Bezier Curve using OpenGL evaluators: glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 30, &points[0][0]); glMapGrid1f(30, 0, 1); glEvalMesh1(GL_LINE, 0, 30); or glBegin(GL_LINE_STRIP); for (int i = 0; i <= 30; i++) glEvalCoord1f((GLfloat) i/30.0); glEnd(); When number of points exceeds 8, curve disappears....

Java SWT - dissolve (fade) from one image to the next.

I'm pretty new to Java and SWT, hoping to have one image dissolve into the next. I have one image now in a Label (relevant code): Device dev = shell.getDisplay(); try { Image photo = new Image(dev, "photo.jpg"); } catch(Exception e) { } Label label = new Label(shell, SWT.IMAGE_JPEG); label.setImage(photo); Now I'd like photo to ...

Image drawing library for Haskell?

I'm working on a Haskell program for playing spatial games: I have a graph of a bunch of "individuals" playing the Prisoner's Dilemma, but only with their immediate neighbors, and copying the strategies of the people who do best. I've reached a point where I need to draw an image of the world, and this is where I've hit problems. Two o...

BlackBerry - Convert EncodedImage to byte []

I am using below code where i don't want to use JPEGEncodedImage.encode because it increases the size. So I need to directly convert from EncodedImage to byte array. FileConnection fc= (FileConnection)Connector.open(name); is=fc.openInputStream(); byte[] ReimgData = IOUtilities.streamToBytes(is); EncodedImage encode_image = Enco...

Pythagoras tree with g2d

I'm trying to build my first fractal (Pythagoras Tree): in Java using Graphics2D. Here's what I have now : import java.awt.*; import java.awt.geom.*; import javax.swing.*; import java.util.Scanner; public class Main { public static void main(String[] args) { int i=0; Scanner scanner = new Scanner(System.in); System.o...

Java 2D graphics performance questions.

1) Is their any performance loss when making a new image with bitmask transparency, drawing just a few things on it then drawing it on top of another; versus drawing the same image in the same conditions, but with the background cleared to an opaque color ? 2) What is the importance of the performance loss when drawing multiple images v...

Calculating 2D angles for 3D objects in perspective

Imagine a photo, with the face of a building marked out. Its given that the face of the building is a rectangle, with 90 degree corners. However, because its a photo, perspective will be involved and the parallel edges of the face will converge on the horizon. With such a rectangle, how do you calculate the angle in 2D of the vectors ...

Inserting an image with Cimg Graphics library

Hi!can anybody explain how to insert a JPEG image with the CImg Graphics library in VC++? ...

Getting a gestureoverlayview

I have been using some nice tutorials on drawing graphics on my android. I wanted to also add in the cool gesture demo found here: http://developer.android.com/resources/articles/gestures.html That takes these lines of code: GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures); gestures.addOnGesturePerformed...

Recommendations for a simple 2D graphics python library that can output to screen and pdf?

Hello: I'm looking for an easy-to-use graphics lib for python that can output to screen as well as pdf. So, I would use code to draw some stuff (simple prims like ovals, rectangles, lines and points) to screen and then when things look good, have it output to pdf. Make sense? Thanks! Blue ...

Blackberry - ListField with images from filesystem

I use the following code to retrieve image from the phone or SDCard and I use that image in to my ListField. It gives the output but it takes very Long time to produce the screen. How to solve this problem ?? Can any one help me?? Thanks in advance!!! String text = fileholder.getFileName(); try{ String path="file:///"+fileholder.getPat...

Problem with some auto-refresh that happens on a button when mousehover

I've been working on a windows application lately. It's build up from several classes that basically draw an image together. After that was done, I made 2 buttons with an event on click that changed a few colors of the drawn objects. Everything works fine including the buttons, but my problem is that each time I hover over the buttons w...