graphics

Unable to trim the string in PrintDocument

I have some string to print on PrintDocument using its graphic object using following code, and I'm expecting if rectangle area in small to fit whole string it show trim it with ellipses but the trimming is not applied to the drawn string, is there any thing wrong in the code? (If draw string on windows form it works) PrintDocum...

Sorting a list of colors in one dimension?

I would like to sort a one-dimensional list of colors so that colors that a typical human would perceive as "like" each other are near each other. Obviously this is a difficult or perhaps impossible problem to get "perfectly", since colors are typically described with three dimensions, but that doesn't mean that there aren't some sortin...

ASP.NET/Vb.net: How to create a frame after an image is uploaded ?

Hi guys, i would like to create a fixed size frame for user photos uploaded. I've tought: i, can create a fixed sized image (200 width x 600 height for example), with my personal frame (top, left, bottom, right element graphics) , and in the center a transparency. Ok, but i don't know how to merge the photo into the frame and save the n...

Computer graphics research

What are the best known labs for research in CG especially raytracing/rendering? I want to pursue Masters/PhD in this field and though I have been working on projects such as raytracers, it is all self-driven. What would be a good place to start, perhaps as a research intern? Also, what kind of background is expected for admissions in th...

Simple graphics API with transparency, polygons, reading image pixels?

I need a simple graphics library that supports the following functionality: Ability to draw polygons (not just rectangles!) with RGBA colors (i.e., partially transparent), Ability to load bitmap images, Ability to read current color of pixel in a given coordinate. Ideally using JavaScript or Python. Seems like HTML 5 Canvas can hand...

How to create Bitmap object from a Graphics object ?

How to create Bitmap object from a Graphics object ? I would like to read pixels from my Graphics object. for example, like, System.Drawing.BitMap.GetPixel(). I am trying to find out empty area (all white, or of any colour) inside a pdf document, to write some graphics / image. I have tried like this, but it is not working. why the foll...

Is there a tool out there that lets you print a colour chart / palette of colours used on a web page?

I want to print a table of the colours used in a web page that my graphic designer has produced - I have .png files at present and use Fireworks to view them. It would be great if there was a tool that lets you print a table with the colour and hex value so I can easily reference when programming. Anyone come across such a thing? Sounds...

How do I draw an ellipse with arbitrary orientation pixel by pixel?

Hi, I have to draw an ellipse of arbitrary size and orientation pixel by pixel. It seems pretty easy to draw an ellipse whose major and minor axes align with the x and y axes, but rotating the ellipse by an arbitrary angle seems trickier. Initially I though it might work to draw the unrotated ellipse and apply a rotation matrix to eac...

How to draw the "trail" in a maze solving application

Hello i have designed a maze and i want to draw a path between the cells as the 'person' moves from one cell to the next. So each time i move the cell a line is drawn Also i am using the graphics module The graphics module is an object oriented library Im importing from graphics import* from maze import* my circle which is my ...

ActionScript Aligning Graphics Line Style Stroke?

is it possible to align the stroke of a graphic with actionscript? for example, the following code creates a black rounded rect with a grey stroke that is automatically centre aligned. var t:Sprite = new Sprite(); t.graphics.lineStyle(5, 0x555555); t.graphics.beginFill(0, 1); t.graphics.drawRoundRect(25, 25, 200, 75, 25, 25); t.graphic...

Copy Form's image to bitmap in memory

How can I copy the image in the clientrectangle of my form to a bitmap in memory? I know how to go from bitmap to form, but not the other way around. Thanks! ...

How to Use Shaders with OSMesa?

Hello Everyone, I am building a dll, which cannot have any dependencies, so I have to compile all the Mesa source code along with it. Now I got the basic opengl drawing working, but I cannot get shaders to work with OSMesa(Offscreen rendering). All the shader examples that come with the sample projects in Mesa have GLEW.h included. But O...

How to create a "Clustergram" plot ? (in R)

Hi all, I came across this interesting website, with an idea of a way to visualize a clustering algorithm called "Clustergram": I am not sure how useful this really is, but in order to play with it I would like to reproduce it with R, but am not sure how to go about doing it. How would you create a line for each item so it would sta...

Problem when trying to use simple Shaders + VBOs

Hello I'm trying to convert the following functions to a VBO based function for learning purposes, it displays a static texture on screen. I'm using OpenGL ES 2.0 with shaders on the iPhone (should be almost the same than regular OpenGL in this case), this is what I got working: //Works! - (void) drawAtPoint:(CGPoint)point depth:(CGFloa...

Is Graphics.DrawImage asynchronous?

Hi all, I was just wondering, is Graphics.DrawImage() asynchronous? I'm struggling with a thread safety issue and can't figure out where the problem is. if i use the following code in the GUI thread: protected override void OnPaint(PaintEventArgs e) { lock (_bitmapSyncRoot) { e.Graphics.DrawImage(_bitmap, _xPos, _yPos); ...

Edges on polygon outlines not always correct

I'm using the algorithm below to generate quads which are then rendered to make an outline like this http://img810.imageshack.us/img810/8530/uhohz.png The problem as seen on the image, is that sometimes the lines are too thin when they should always be the same width. My algorithm finds the 4 verticies for the first one then the t...

How to create a dashed line rounded rectangle in Flex?

How can I create a rounded rectangle with a dashed line? I've seen several routines that draw their own straight lines, but nothing for rounded rectangles. ...

What's the simplest and fastest way to draw a parse tree using .Net?

I've written a simple top down parser using c#. It's a console application. I'd like the parser could save, at the end of the computation, an image file of the parse tree. I think I could use graphviz, but I'd like to know your opinion. Thanks. ...

how to draw square after load the application in iphone(graphics) ?

how to draw square after load the application in iphone(graphics) ?(I know how to draw shapes but i exactly want to show draw shape after my app. launch what can i do) and also want to fill color after app. launch ? ...

efficient algorithm for drawing circle arcs?

I am using the mid-point circle algorithm (bresenham circle) to efficiently draw whole circles. Is there something similar to draw circle arcs? I would like to specify a start angle and end angle and have only that portion of the circle drawn. Thanks in advance! EDIT: I would like to draw filled circle arcs too, i.e pie-slices. :) ...