graphics

Icons/graphics for your applications

I need to source some graphics/icons for my application I'm writing (Windows WinForms). I need graphics for toolbar buttons, icons for form headers and graphics for wizard dialog boxes. As a last resort I'm willing to create them myself - a move that might make them (and my whole application) look amazingly bad. What are some good sou...

What is the best way to draw objects and deal with them?.

Hi, I want to draw on my PictureBox and then deal with those drawings that i created. is it a good way to store their points in an array and deal with this array??. Or the better way is to make them objects and deal with these objects?.And if so could you please put me on the head of way to make that??. Thank you my really teachers. ...

How are Swing components internally created, laid out, repainted, notified of events, ...?

Hello! I wonder if there's a good documentation (or a (viewable) ebook) about the lifecycle of Swing components. Is "lifecycle" the correct term, anyway? I hope to find answers to question such as: How, when, in which order painting methods are called? How, when, which events are called by whom? What is the exact sequence of method ...

Is it a good idea to divide every graphic shape in two parts - its geometry and rendering components?

I am writing a simple graphic editor for a university project using C#. I created a hierarchy where every type of shape - circles, rectangles, ellipses, ... - are inherited from a base class Shape, it contains a shape color as a protected field. public abstract class Shape { protected Color color; public Shape(Color c)...

Is there difference in the graphic library?

To a library displaying a graph, there are libraries (HTML5.JP) for library (JpGrapth) and javascript for PHP. When I build Web application, the too big difference thinks that there is not it in a user even if I use whichever, but will there be a fact, a merit by the difference of these languages, the demerit?  Which does own use? ...

Owner Draw ListView "smearing" when scrolling

I have an ownerdrawn ListView that "smears" when I scroll. It only affects the last displayed item as it moves into the visible are of the list... It looks like: Blah Blah Blah ...have all been drawn on top of each other 1 pixel apart. The code in the DrawItem event is of the form Rectangle rect = new Rectangle(e.Bounds.X +...

Border in DrawRectangle

Well, I'm coding the OnPaint event for my own control and it is very nescessary for me to make it pixel-accurate. I've got a little problem with borders of rectangles. See picture: These two rectangles were drawn with the same location and size parameters, but using different size of the pen. See what happend? When border became la...

Is it less expensive to dc->DrawLine() a bunch of times or one blit?

I have a control that has a grid. Is it more expensive to draw the horizontal and vertical lines that make up the grid each time using the draw line function in the device context class or would it be faster to draw the grid once to a memory device context and then blit it each time to the window dc? Thanks. ...

iPhone + Quartz: How to get a water effect

Hello, ist there any chance to build a water effect with Quartz on the iPhone? Something similar to this one: ...

How to render a gradient in memory using GDI(+)

Hi, I am trying to render an Image object in memory with the dimensions 1x16. This image is used as a tiled background. The gradient itself should have 3 colors in a non-linear fashion. Pixel 1 to 6: Gradient Color 1 to Color 2 Pixel 7 to 16: Gradient Color 3 to Color 4 ...

C#: Retain size despite different resolution using Graphics.DrawImage

I am trying to draw two images side-by-side using the C# Drawing namespace. Here is a very simple example that assumes we have two images of the same height: Image[] oldImages = GetOldImages(); var newImage = new Bitmap(oldImages[0].Width + oldImages[1].Width, 800); using (var newImageGraphics = Graphics.FromImage(newImage)) { ne...

Framework/library for simple 2D animation in Java?

I want to write a very simple game in Java to demonstrate a wireless controller I've built. I thought of something like Breakout or Pong. Currently, I have a prototype Pong implementation that does all animation directly using the AWT functionality. However, this is somewhat awkward to program and also a major CPU hog. My question: Can...

DirectX Overlay inside a Window

Hello all I need to be able to set an overlayed graphics area (via DirectX/DirectDraw methods) in any place on the screen, or at least to use it inside a windowed area. Anyone was able to do this? Tks in advance ...

How can I get rid of jerkiness in WinForms scrolling animation?

I'm writing a simple control in C# that works like a picture box, except the image is constantly scrolling upwards (and re-appearing from the bottom). The animation effect is driven by a timer (System.Threading.Timer) which copies from the cached image (in two parts) to a hidden buffer, which is then drawn to the control's surface in it...

c# graphics creation

I have some code that is used to programmatically create a Document to send to the printer. It goes something like this: private void pd_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs ev) { ev.Graphics.DrawImage(pictureBox1.Image, 50, 100); string drawToday="Date : "+strToday; string d...

Drop shadows on iPhone Clock App "Alarm" tab

In the clock app that comes with the iPhone there is a tab view for setting alarms. In that view each of the UITableViewCell instances have a drop shadow around them. Does anyone know how to achieve the same effect? Also it looks like the tab bar at the very bottom has a drop shadow above it as well. Ideas on how to achieve the same l...

How to copy Gdk.image?

Is it possible to make a copy of Gdk.image object using lablgtk2 for Ocaml? I tried to find 'copy' or 'clone' methods but failed. ...

Any graphics library for unix that can draw histograms?

A python program needs to draw histograms. It's ok to use 3rd party library (free). What is the best way to do that? ...

Decomposing a 3d mesh into a 2d net

Suppose you have a 3 dimensional object, represented as a 3d mesh in some common file format. How would you devise an algorithm to decompose the mesh into one or more 2d 'nets' - that is, a 2-dimensional representation that can be cut out and folded to create the original 3d object. Amongst other things, the algorithm would need to acco...

How do I plot to an image and save result without displaying it, in matlab

Hi, This question kind of starts where this question ends up. Matlab has a powerful and flexible image display system which lets you use the imshow and plot commands to display complex images and then save the result. For example: im = imread('image.tif'); f = figure, imshow(im, 'Border', 'tight'); rectangle('Position', [100, 100, 10,...