graphics

Change Black pixels to white and vice versa

Hey there, I can't figure out how to make Jython realize that the pixel is either (0,0,0) or (255,255,255). Basically I'm just trying to convert all white pixels to black and vice versa. Here's what i have sofar :S def changeBlackWhite(picture): for x in range(getWidth(picture)): for y in range(getHeight(picture)): ...

My JOGL crashes if I'm not using an external monitor

This seems insane, but I've been able to reproduce an issue where my JOGL app crashes if I'm not using an external monitor. All I do is start the app, and it immediately becomes unresponsive. If I plug in an external monitor, the problem disappears. If I let the app run, then randomly pause it in a debugger, I get the following stack tr...

Why does my smudge image algorithm make the image darker?

I'm trying to write a graphical effect where a circle moves around an image smudging the image as it goes (like the way the smudge tool in Gimp or Photoshop would work). The basic algorithm I'm using is: the circle moves from position A to position B on the bitmap copy a circle of pixels from position A into a temporary bitmap draw thi...

Inverse Kinematics: Calculating the Jacobian

I am trying to do inverse kinematics for a serial chain of arbitrarily many links. In the following paper, I have found an example for how to calculate the Jacobian matrix. Entry (i, j) = v[j] * (s[i] - p[j]) where: v[j] is the unit vector of the axis of rotation for joint j s[i] is the position (int world coords?) of jo...

Printing directly to Ethernet printer using 'raster mode': need basic guidance

I've stumbled across a problem way beyond my area of expertise, and I don't have a mentor to turn to for help with this. I have a receipt printer I need to interface with through an iOS app. The printer is located on the same network as the device(s), so I can address it through supported "Line Mode commands" What I'd like to do is kee...

How to draw text at runtime

Basically, Im making a paint application very similar to MSPaint. The idea is that, that the the user clicks anywhere on the form and should be able to write text in a control. And then following that, that text should be displayed in g.drawstring graphic method. ...

simulate 2D water similar to water in Mario game

what is the the best way/technique to simulate water in 2d ( similar to mario game ) using opengl ? something like this: ...

Sizing image to text in the image with C# System.Drawing / Drawstring

I want to take a string, and a specified font, and create a graphic image that contains that text in box, where the box resizes to the text. I got the code below working, but it sizes the box before doing anything else. Is there some way to resize the image to fit the text (I probably need to add a small border of a few pixels). A...

Silverlight Hardware Accelerated Graphics

Is there anyway to create cross platform hardware accelerated games in Silverlight? (OpenGL binding or something similar) Does libraries like Balder usable for writing large 3D games (e.g MMORPGs) in Silverlight? ...

Can pygame use vector art?

http://cache.kotaku.com/assets/resources/2008/02/dbzburstcell.jpg -edit- bassically just detailed vectorized 2d games. When making a side scroller in pygame or any other comparable 2d framework with python, can you utilize graphics such as in the above link? Thanks. ...

Python: Find the min, max value in a list

alist = [(1,3),(2,5),(2,4),(7,5)] I need to get the min max value for each position in tuple. Fox example: The exepected output of alist is min_x = 1 max_x = 7 min_y = 3 max_y = 5 Is there any easy way to do? ...

I want Flood Fill without stack and without recursion.

I wanted to know how to apply flood fill on array , my array is two dimensional , which contains times new roman font type letter boundry. The boundry line contains 1's and inside and outside all 0's. I want to fill all 1's instead 0 in only inside. But i need a logic which do not required more memory. So avoid recursion and stack or que...

Algorithm for a smudge tool?

I'm trying to implement a smudge tool like one you would find in Gimp or Photoshop. I've tried lots of variations but they all have problems. The basic method I've tried for smudging from position P1 to P2 on an image is: Copy a rectangle the size of the current brush from P1. Draw this rectangle at P2 with a low opacity. It looks fi...

drawing a string with a transparent background using C# ?

The standard way of g.DrawString creates a gray background. So if overlay another string on the form, part of it appears gray. My question is, is there any way to draw a string with a transparent background? i want to be able to overlay strings, but still be able to see them. ...

C# graphic book

Hi All, I need a C# graphics programming book that contains the subjects such as the curves between 3D surface and 2D surface, 3D surfaces crossing each other, etc. Could you advise me a book name. Regards, Can ...

.net DrawString Hebrew font with zero-width characters

Are there any additional properties or parms in the DrawString to solve this problem. I have a Hebrew font with many zero-width characters so that two characters should render in the same location. This example shows the .NET problem on the left, and what is should look like on the right: http://hebrewresources.com/html5/images/ren...

How to get X & Y resolution in DPI for the android platform?

How do I obtain the X & Y resolution of a Bitmap in DPI on the android platform? I'm expecting some api like 'GetXResInDPI()' like below : double getXResolution(Bitmap bmp) { double lXRes = Bmp.GetXResInDPI(); return lXRes; } I'm unable to obtain any such method for the android platform in spite of scourging through the java do...

Any other game SDK besides CORONA for the iphone/ipad

Does anyone know of another good game SDK/Engine for the ipad or iphone other than CORONA? ...

Drawing a stick-man in AS3

A stickman is defined as a set of points, a set of lines between certain points, and other simple shapes (like a circle for a head). It looks to me like the easiest route in AS3 is to use a Shape/Sprite's Graphics property to draw these lines, clearing and re-drawing each time the stickman changes. But some of the newer Flash 10 stuff s...

How to calculate vector value of polygon's edges to determine whether its direction is clock-wise or counter clock-wise?

How to calculate vector value of polygon's edges to determine whether its direction is clock-wise or counter clock-wise? ...