graphics

How to draw subsection of text using .net graphics

I'm doing custom drawing in datagridview cells and I have items that can vertically span across multiple cells. An item displays text and the issue at hand is how can I draw just the cell's part of the text? I have the item's rectangle and the cellBounds. Currently, I am drawing all the text on each cell paint i.e. I'm drawing over cel...

How to draw 3D mathematical models in .NET? What 3D engine would best suitable to do this effectively?

Hi, I recently faced a problem of presenting the output of simple genetic algorithm that looks for extremes of 2 argument function f(x1,x2) . I would like to be able to use x1 as x, x2 as y and f as z and to draw points in 3d space that I could rotate. ( I'm currently drawing this on bitmap using color as the 'z axis'.) Where should I ...

Polygon Triangulation with Holes

I am looking for an algorithm or library (better) to break down a polygon into triangles. I will be using these triangles in a Direct3D application. What are the best available options? Here is what I have found so far: Ben Discoe's notes FIST: Fast Industrial-Strength Triangulation of Polygons I know that CGAL provides triangulation ...

Best sources for graphical assets for the hobbyist programmer?

This should be closed as an exact duplicate of this quesion. For those of us who develop software or websites in our spare time with little or no budget, what are your best resources for icons and other graphics? Do you have good sources that have free or Creative Commons licenses? Or do you create your own? ...

Silverlight 2: Text Glow effect?

I'd like to create an outer-glow (or halo) effect on a text block in Silverlight. (For PS3 users, something similar to the glow around the menu text on that system). I've seem samples to do inner and outer glow on other shapes, such as rectangles but this does not translate to text. Just wondering if anyone has pointers to help me. ...

Painting a Canvas in an Applet

Hi all, I currently have a small Java program which I would like to run both on the desktop (ie in a JFrame) and in an applet. Currently all of the drawing and logic are handled by a class extending Canvas. This gives me a very nice main method for the Desktop application: public static void main(String[] args) { MyCanvas canvas = ...

What is the preferred way to show large images in OpenGL

I've had this problem a couple of times. Let's say I want to display a splash-screen or something in an OpenGL context (or DirectX for that matter, it's more of a conceptual thing), now, I could either just load a 2048x2048 texture and hope that the graphics card will cope with it (most will nowadays I suppose), but growing with old-scho...

Convert CYMK image to RGB using BOOST::GIL

I am trying to use the boost generic image library to convert CYMK images to RGB. The following code does not compile // read cmyk image file cmyk8_image_t img; jpeg_read_image( "1502-T2-C-PER.jpg", img ); // convert to rgb rgb8_image_t rgb( img.dimensions() ); copy_pixels( color_converted_view<rgb8_image_t>(view(img)), view(rgb)); ...

How to determine width of a string when printed?

I'm creating a custom control, part of which is using the Graphics class to draw text to the form. Currently I'm using the following code to display it: private float _lineHeight { get { return this.Font.Size + 5; } } private void Control_Paint(object sender, PaintEventArgs e) { Graphics g = this.CreateGraphics(); Brush b = new ...

When are VBOs faster than "simple" OpenGL primitives (glBegin())?

After many years of hearing about Vertex Buffer Objects (VBOs), I finally decided to experiment with them (my stuff isn't normally performance critical, obviously...) I'll describe my experiment below, but to make a long story short, I'm seeing indistinguishable performance between "simple" direct mode (glBegin()/glEnd()), vertex array ...

How to achieve full-scene antialiasing on the iPhone

I would like to achieve FSAA on my OpenGL ES app on the iPhone. Currently I do this by rendering the scene to a texture that is twice the width and height of the screen. I then use the nice function: void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height); to draw the image resized to the screen resolution. Is there...

Imaging Question: How to determine image quality?

I'm looking for ways to determine the quality of a photography (jpg). The first thing that came into my mind was to compare the file-size to the amount of pixel stored within. Are there any other ways, for example to check the amount of noise in a jpg? Does anyone have a good reading link on this topic or any experience? By the way, the ...

how to force Java print graphics in 300dpi

as I googled for problem, somehow java printing API is crippled with limitation that all pictures sent to printer must be printed in 72dpi resolution. We are using jasper report to print documents and no matter how big barcode we draw, barcode reader won't scan it.. any similar experiences? How to solve this issue? ...

3d models, LOD, pics, etc

I need to program a util for a 3d model. What i need to do is pass the 3d model to the util and have it extract multiple information. Things like poly count, size/scale (if applicable) and anything else i can grab. Then i need to take a screen shot of the model 8 times (45deg from 0 to 360). Maybe 16. Is there an app that i can use to ex...

How do I draw double height text using Graphics.DrawString?

I am trying to emulate a POS printer with System.Drawing and one of the functions I need is to draw text at double height. Any idea how I can do this using .Net's Graphics class? Do I need to draw the text twice as large and condense it or draw normal size and then stretch? Both seem like messy options but is there an alternative? ...

Are there (free) tools or libraries for 3D WPF objects?

I wanted to play around with some 3D controls in WPF, but was mildly surprised to find that there were no primitive solid controls in WPF - I just wanted to plop a few spheres and cubes in a scene, but didn't realize I had to render them using meshes. Surely someone has created libraries of 3d primitives that can be added to WPF 3D scen...

best tool for step/iges to stl conversion?

I need code to my app that converts CAD files (mostly .step, .iges) into 3D surface models (.stl). Do you have a suggestion? Freely available stuff? (One suggestion per posting) ...

Can Graphics.DrawImage unintentionally trim an image?

I'm using code that takes a bitmap and converts it to 24 BPP so that I can use it in a program that specifically requires that file format. Here is the code: using (Bitmap tempImage = new Bitmap(pageToScan.FullPath)) { if (tempImage.PixelFormat != System.Drawing.Imaging.PixelFormat.Format24bppRgb) { using (Bitmap tem...

How do I project lines dynamically on to 3D terrain?

I'm working on a game in XNA for Xbox 360. The game has 3D terrain with a collection of static objects that are connected by a graph of links. I want to draw the links connecting the objects as lines projected on to the terrain. I also want to be able to change the colors etc. of links as players move their selection around, though I ...

How do I get a common-lisp GUI in Windows?

I'm using Emacs, with CLISP and Slime, and want to be able to draw pictures on the screen. I'm specifically thinking about drawing graphs, but anything that would let me draw basic shapes and manipulate them would be able to get me started. ...