graphics

how to make winxp ms-dos virtual machine work like win98 ms-dos especially graphics

Hi, Initially... I started programming in C. that was was 10 years back(college). The IDE i used was Turbo C++ IDE. All my c programs were 16bit. Memory Model : Huge. Graphics : 4bit (16 colors). Graphics Driver: EGAVGA.BGI Resolution: 640x480. OS: MS-DOS 6.0 (under windows98 it is 7.0 - which always gave an accelerated execution of...

Overlay Canvas Pixel Data

How do I blend these two sets of pixelData? The maskArray specifies the pixels to use from the OverlayData. These need to be merged with the backgroundData, and inserted back into the main canvas as newBackgroundData, and as offsetX changes update as needed. update I think I have found a solution: simply create another hidden canvas, a...

Ray tracing in modern OpenGL. Where do I begin?

So I'm at a point that I should begin lighting my flatly colored models. The test application is a test case for the implementation of only latest methods so I realized that ideally it should be implementing ray tracing (since theoretically, it might be ideal for real time graphics in a few years). But where do I start? Assume I have n...

Cost much memory when creating serveral vertex and index buffer

Hi, guys, I met a very weird issue. When I create some very simple VertexBuffer and IndexBuffer in D3D, the memory comsuption reported from TaskManager is huge. I created 60000 index buffer via D3D CreateIndexBuffer method. Each index buffer contains 6 index (int) which represents two triangles. So, one index buffer will occupy 24 bytes...

HLSL Translucent Plastic Shader

Hi, I'm trying to produce a shader to replicate a white plastic object with a colored light inside. Either by having a shader that will be translucent and if I put a light inside the object the light will show through or by having a shader that fakes the effect of a light inside. The effect im going for is kinda like a light going thro...

GLSurfaceView swaps 2D bitmaps being drawn

I have an application that receives information from a database, and is used to visualize 2D bitmaps onto a GLSurfaceView. The information received will determine the x-position of the bitmap, and which bitmap image to use (there are 4 different bitmaps in my res folder to choose from). Below are the three classes that are being used. ...

Java: Composite

Hi, I'm implementing a diagram that shows the level of a container. Depending on the fill level, the colour of the line should change (for instance, close to the maximum it should show red). Rather than calculating different segments of the line and setting their colours manually, I'd like to define a band in which the colour automatica...

How can I draw a border with squared corners in wpf?

You know, like Battlestar paper! I have given this a few goes but now I'm stumped. I haven't yet gone down the geometery route, so I'll explain this as best as I can. I'd like the border to be sizable, but contain fixed-size corners, just like CornerRadius does. Instead of rounded corners, I'd like them to be tapered, like: /---------\...

AND two bitmaps in C#

Hi all, I'm trying to AND two bitmaps like this: [DllImport("gdi32.dll")] public static extern int SetROP2(IntPtr hDC, int nDrawMode); const int SRCAND = 0x008800C6; // AND raster op. lock (g.Clip) { IntPtr pDC = g.GetHdc (); SetROP2 (pDC, SRCAND); g.Draw...

PNG transparency not blended properly in iPhone app?

This is my first iPhone app in which I am importing images wholesale from Photoshop. Some aren't rendering properly. The following image is a white button with rounded corners; the transparency overall is being preserved, but the blending from the image to the transparent pixels results in a white edge around each corner: http://adamb...

Graphics performance optimization issue

Here's the problem : I need to scroll a huge image of a wave form that has been rendered previously, WPF didn't let me assign that huge (80000*256) picture to an Image, it works for smaller (30000*256) images but it's so slow animating it that it's unpractical. So what I decided was to use a WriteableBitmap that I assign to my Image.So...

SVG Glyphs in Pyqt

How do I render glyphs in pyqt using the svggraphicsItem? ...

How to handle ball to ball collision with trigonometry instead of vectors?

I am making a simplified version of the ball physics app found at this SO question. I gained a lot from reading through the code and links provided at that question, but in my program I do not use vectors, I just update the coordinates of my balls (each of which has a random angle and speed) with trigonometry functions when they hit the...

Bitmap cant find a pixel on itself!

Scenario: 1) Program going to draw a string (commonly a single character) on a bitmap: protected void DrawCharacter(string character, Font font) { if(string.IsNullOrEmpty(character)) character = "."; FontFamily f = new FontFamily(FontName); bitmap = new Bitmap((int)(font.Size * 2f), (int)font.Height); ...

Renderware Alternative

I know this is old news but EA bought out Criterion and killed Renderware, citing some ridiculous "it's not good enough for next-gen" reason. Anyone know of a good, solid alternative? I really DON'T want to have to reinvent the wheel for multiple platforms -_- ...

Plotting with R - skewed eps image & resolution problem

Hello, I want to create a graphics of a function in R. The code is: x <- seq(from=0, to=1, by=0.00001) f <- function(x) .... y <- f(x) plot(x, y, xlab="x", ylab="f(x)", pch=16, cex=0.5) min(y) [1] 0.2291203 max(y) [1] 0.7708797 When I save the graphics as bmp from RGui, it looks like here and this is fine. When I save it as...

How can I use Alpha Compositing (Porter and Duff) with C#?

Are there a implementation (API) of Alpha Compositing for .NET. The Wikipedia means that Windows has a native implementation of it. Of course it can be do with pixel manipulation but this will be a bad performance. If there are a native implementation then we should use it. If there is no native implementation that can be used from .NET...

Making Asteroids Game In C#

So I am currently trying to make the game Asteroids for a class. The problem is, I haven't done any coding for about 3/4ths of a year since the last time I had the class and forgot almost everything I learned. I need to move the ship using thrust/acceleration but also cap it, and have friction so that when the thrust stops, the ship slow...

What is the point of GLSL when there is OpenCL?

Consider this the complete form of the question in the title: Since OpenCL may be the common standard for serious GPU programming in the future (among other devices programming), why not when programming for OpenGL - in a future-proof way - utilize all GPU operations on OpenCL? That way you get the advantages of GLSL, without its program...

OpenGL texture tiling with texture matrix.

Hey guys, I know you can do texture tiling in OpenGL by setting the texture coordinates to something like 2.0 but is there a way I can do texture tiling with OpenGL texture matrix? ...