graphics

Efficient way to swap any given two colors in image using .NET Compact Framework

Is there an efficient way to take and image and be able to replace a given color with another given color using .NET Compact Framework? For example, to replace white with black or vice versa? ...

What is Vertex and Pixel shaders?

What is Vertex and Pixel shaders? What is the difference between them? Which one is the best? Thanks! ...

Antialiasing alternatives

I've seen antialiasing on Windows using GDI+, Java and also that provided by Photoshop and Gimp. Are there any other libraries out there which provide antialiasing facility without depending on support from the host OS? ...

Boolean Operations on Cairo Paths?

Is there any way to build paths in Cairo by combining two paths together through Boolean operations such as Union, Difference, and Intersection? I'm working on a vector graphics application that uses Cairo to do its rendering and would like to give my users the ability to combine paths together in this manner, but I can't find a way to d...

Making a drawing program

I am making a drawing program, and have a few question with regards to that. I'll need the user to have the choice of drawing a rectangle, an oval and a line. I suppose I need to make a super class they all derive from. Should I make this an interface or an abstract class? And how would I set up that all the shapes have some default val...

Problem when using MemoryDC

Why does my code print the lines gray instead of black? import wx class MyFrame(wx.Frame): def __init__(self,*args,**kwargs): wx.Frame.__init__(self,*args,**kwargs) self.panel=wx.Panel(self,-1,size=(1000,1000)) self.Bind(wx.EVT_PAINT, self.on_paint) self.Bind(wx.EVT_SIZE, self.on_size) self....

Generating Professional Graphs In Windows

In Windows, I am looking at generating professional graphs using any mainstream programming language (C#, VB.Net, Java, PERL, etc). The best free looking graphs I have found so far is Microsoft Chart Controls for .NET. What other graph controls/modules do you suggest? Note: Added free to the requirements. ...

How can I draw a bitmap rotated in wxPython?

How do I draw a bitmap to a DC, while rotating it by a specified angle? ...

Blanket Alpha Component in GDI+

Is there a way I can set an Alpha value that affects all subsequent GDI/GDI+ calls? in other words, I am looking to set the transparency for all calls on a Graphics object. (I'm looking for something similar to how the *Transform functions affect the Graphics object they are called on) ...

How to draw text on picturebox?

Hello, I googled for "Drawing text on picturebox C#" ,but I couldnt find anything useful.Then I googled for "Drawing text on form C#" and I found some code,but it doesnt work the way I want it to work. private void DrawText() { Graphics grf = this.CreateGraphics(); try { grf.Clear(Color.White...

How to do directed graph drawing in PHP?

I'm looking for a way to draw directed graphs in PHP. (as in http://upload.wikimedia.org/wikipedia/commons/0/08/Directed_acyclic_graph.png). I want it to create an image of the graph just like GD can output an image. I've googled a lot on this, but I only can find a lot of libraries for drawing graphs in general (with bars etc), not dir...

Drawing "point-like" shapes in OpenGL, indifferent to zoom

I'm working with Qt and QWt3D Plotting tools, and extending them to provide some 3-D and 2-D plotting functionality that I need, so I'm learning some OpenGL in the process. I am currently able to plot points using OpenGL, but only as circles (or "squares" by turning anti-aliasing off). These points act the way I like - i.e. they don't ...

Graphics Profiling

Ive got an application which drops to around 10fps. I profiled it with xperf which showed my app was using just 20% of the CPU, with none of my methods using a larger than expected amount of that 20%. This seems to indicate that the vast drop in fps is because the graphics card isnt able to keep up with rendering the frame, resulting in...

What events can I use in order to notify a control that part of it has left the viewable area of the screen?

Hi, I have a userControl I'm doing some Painting to, and when the control is moved to the edge of the screen, or moved so that the Vista Taskbar overlaps it, the screen edge/taskbar edge is being drawn to the control, leaving ugly lines over the paintable area of the control. What is the best way to detect this and call Invalidate on th...

Are there any sources for getting affordable graphics and sounds for software products and games?

When making software, specially games, those resources like graphics and sounds are something "freaky" that's out of range of the developers brain and feasibility. I mean...sound effects like cool beeps: Who in the world can make them? Almost nobody of us, I guess ;) So: Is there any good legal ressource for this kind of content, which ...

Calculate the image size required to hold a Graphics object

I am writing a barcode application for work, where I create a graphics object and draw the various bars for a code 39 barcode. I create the graphics object with the following code: int reqBarcodeWidth = 100; int reqBarcodeHeight = 40; objBitmap = new Bitmap(reqBarcodeWidth, reqBarcodeHeight); objGraphics = Graphics.FromImage(objBitmap...

How do I bounce a point off of a line?

I'm working on writing a Pong game for my graphics class final project (I choose to write this, I wasn't assigned Pong) and I've run across a problem that wasn't addressed in either the book or the class. I'm trying to figure out how to bounce a point off of a line. The best method I can figure out to do this with is Calculate the ...

ImageIcon + ImageIcon = ImageIcon

Hi, I have two ImageIcons and I want to create a third ImageIcon which has nr 2 drawn upon nr 1. How would I best do that? ...

Collision-Detection methods in C++

I am new to c++ and I have been practicing collision in a small game program that does nothing and I just can't get the collision right So I use images loaded into variables background = oslLoadImageFile("background.png", OSL_IN_RAM, OSL_PF_5551); sprite = oslLoadImageFile("sprite.png", OSL_IN_RAM, OSL_PF_5551); bush = oslLoadImageFile...

JavaFX Designer

At the moment I'm using JavaFX only for fun and learning it. What I find annoying is designing the graphics by coding them and watching the result in a preview window - you know what I mean? Is there something for JavaFX like what Expression Blend is for Silverlight. ...