drawing2d

How do I draw an annulus (doughnut) using GDI+?

I have been trying to draw an annulus (ring with thickness) with a transparent hole and a gradient rim in C# with very little success. Does anyone have any suggestions on how to do this? here's a nice Blend Utility Here's the Final result - thanks to BlueMonkMN Rectangle GetSquareRec(double radius, int x, int y) { double ...

Pygtk graphics contexts and allocating colors

I've searched on this, but nothing has what I'm looking for. http://www.mail-archive.com/[email protected]/msg10529.html -- Nobody answered him. This is exactly what I'm experiencing. When I set the foreground on a graphics context, it doesn't seem to actually change. I've been through the tutorial and FAQ, but neither say much. They e...

Proper Drawing2D class for NET CF?

As I recently found out Drawing2D class of NET CF is missing most of it's functionality. Is there a way to expand it with for example "LinearGradientBrush"? ...

How can I override the canvas in my View?

I am using Android 2.1 and Eclipse. I have defined a LinearLayout with two components that have dimensions: 250 x 250. LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams llp = new llp.LayoutParams(250, 250); meter1View = new MeterView(this, "Meter 1"); ll.addView(meter1Vie...

C# GDI Drawing2D help

What GDI methods can I use to draw the blue shape shown in the image below? The center must be transparent. ...

Create Lines around a guiding line using Miterjoin

Hi SO community! I am drawing graphs into a WinForms Picturebox. Now I am searching for a possibility to 'duplicate' a line (an array of points), so that the two resulting lines are positioned a fixed distance away from the original one. Like in this picture, I have the red line and want to get the black ones: I thought about just m...

How to change colors of a GDI+ LinearGradientBrush?

I have to write several small vertical gradients (on a loop) and so I think it's faster to re-use an existing LinearGradientBrush (correct?) But this isn't what I expected to happen... Drawing2D.LinearGradientBrush myBrush = new Drawing2D.LinearGradientBrush(new Rectangle(0, 0, 200, 200), Color.Red, Color.Black, Drawing2D.LinearGradi...

Primitive thickness - DX10

Hello, i recently stepped into primitive rendering in directX10. I need that because i want to convert my ingame chat from directx9 to 10 due my huge performance lag being forced by the games weak dx9 support. The lines are being rendered fine on the positions i want. My actual problem is that they doesnt appear as thin as in directX9 ...

What's a good 2D graphics drawing API for Windows/C++?

Hey, I've been working on a small little application, and I've been using DirectX/3D to draw textures to the screen (all 2-dimensional elements). The API, I find, is pretty easy to use and to incorporate using OOP principles, but I can't help but feel that using DirectX on something this small is insanely over-kill. I can't seem to fin...

Organization chart algorithm...

Does anyone have a line on an algorithm to place boxes in an organizational chart? Any language is fine. ...

Is there a graphical overview of the HatchStyle enumeration?

A hatch pattern is made from two colors: one defined by the BackgroundColor, which fills the background and one for the lines that form the pattern over the background defined by the ForegroundColor property. The HatchStyle property defines what type of pattern the brush has and can be any value from the HatchStyle enumeration. There are...

How to draw a text image for printing in Java?

I'm trying to create an an image file (eg. .bmp) with text printed on it, so that when chosen for print on paper it occupies all the paper (but for a narrow margin). How do you approach such a problem? This is essentially how I've been doing. final BufferedImage img = new BufferedImage(3500, 2480, BufferedImage.TYPE_BYTE_INDEXED); f...