system.drawing

Image manipulation in asp.net/c# without System.Drawing/GDI+

Is there any alternative image manipulation library for .net? I would prefer something that is managed and open source. I ask this because of two reasons: I have encountered hard to debug GDI+ errors with System.Drawing in the past I have read that using System.Drawing in asp.net web applications is not 100% supported. Thanks! ed...

.Net drawing clipping bug

gdi+ DrawLines function has a clipping bug that can be reproduced by running the following c# code. When running the code two line paths appear that should be identical, because both of them are inside the clipping region, but when the clipping region is set one of the line segment is not drawn. protected override void OnPaint(PaintEv...

Why I get an "Canvas does not allow drawing" while drawing in TeeChart ActiveX 5 component?

I'm using Steema's TeeChart ActiveX 5 component for an application in .NET C#. I do some drawings using the methods Line(), Rectangle() and Circle() through the "Canvas" property of the component. My code for drawing is called on every on every OnBeforeDrawSeries() and OnAfterDraw() events of the component. When there is only a few dr...

How can I build C# ImageList Images from smaller component images?

I'd like to make status icons for a C# WinForms TreeList control. The statuses are combinations of other statuses (eg. a user node might be inactive or banned or inactive and banned), and the status icon is comprised of non-overlapping, smaller glyphs. I'd really like to avoid having to hand-generate all the possibly permutations of ...

How do you Draw Transparent Image using System.Drawing?

I'm trying to return a transparent GIF from an .aspx page for display within a web page. I am trying to get the image to have transparency, but I just keep getting Black being where the image should be Transparent. Does anyone know what I'm doing wrong? Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Ha...

System.Drawing.Image for Images in Business Objects?

Hi Folks I'd like to store an image in a business object. In MSDN I saw that the System.Drawing-namespace provides lots of GDI+-features, etc. Is it okay to store an Image in an System.Drawing.Image class in business layer (which is a class library "only"), and thus including a reference to System.Drawing too? I slightly feel just kind...

Getting .Net Font information?

Is there a wrapper around the Win32 API for getting font information without actually instantiating an instance of the .NET Font class? For example, some fonts do not have a regular style so I need to determine what styles are valid for a font without actually creating an instance of it. ...

.net drawing: problems scaling a pen

System.Drawing: I found a post (with no answer) that explains my problem very nicely: http://groups.google.com/group/microsoft.public.test.here/browse_thread/thread/21b768eb66270b9d?hl=en&ie=UTF-8&q=Pen+width+scaletransform+group:microsoft*#47964cfcad0d0bc8 I'm having trouble controlling the Pen width where the graphics are tr...

System.Drawing in Windows or ASP.NET services

According to MSDN, it is not a particularly good idea to use classes within the System.Drawing namespace in a Windows Service or ASP.NET Service. Now I am developing a class library which might need to access this particular namespace (for measuring fonts) but it cannot be guaranteed that the host process is not a service. Now there is ...

How to open a multi-frame TIFF imageformat image in .NET 2.0?

Image.FromFile(@"path\filename.tif") or Image.FromStream(memoryStream) both produce image objects with only one frame even though the source is a multi-frame TIFF file. How do you load an image file that retains these frames? The tiffs are saved using the Image.SaveAdd methods frame by frame. They work in other viewers but .NET Imag...

WPF v/s System.Drawing

I have to code a simple control in .Net that draws geometry that looks like following image and the geometry doesn't get any more complex than shown in this image, i.e. it will be a few filled polygons and some dashed lines. This is not a static image however, that is drawn once and forgotten. The dimensions of the geometry can changed b...

Unit testing drawing control

Based on my previous question here my new concern is how do I unit test my drawing code? ...

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? ...

Disposing a static brush

Hi, I'm writing a biorhythm app. To test it i have a form with a Button and a PictureBox. When I click on the button i do myPictureBox.Image = GetBiorhythm2(); Which runs ok for the first time, but on the second click it causes the following exception: System.ArgumentException: Parameter is not valid. at System.Drawing.Graphics.Ch...

Convert Pixels to Inches and vice versa in C#

I am looking to convert pixes to inches and vice versa. I understand that I need DPI, but I am not sure how to get this information (e.g. I don't have the Graphics object, so that's not an option). Is there a way? ...

Image representation suitable for both WPF and Windows Forms

When working with Windows forms and images, I deal with System.Drawing.Image descendats. When I work with WPF I deal with System.Windows.Media.Imaging.BitmapSource class. Is there a UI framework independent way of referencing a memory image? Maybe it would be a Intptr or byte array? Thank you. ...

Image.FromHbitmap WPF equivalent

Hello. Is there a System.Drawing.Image.FromHbitmap equivalent in WPF? Also, is it possible to dispose the handle properly after creating an image? Thank you. ...

Cannot render image to HttpContext.Response.OutputStream

Basically I am trying to render a simple image in an ASP.NET handler: public void ProcessRequest (HttpContext context) { Bitmap image = new Bitmap(16, 16); Graphics graph = Graphics.FromImage(image); graph.FillEllipse(Brushes.Green, 0, 0, 16, 16); context.Response.ContentType = "image/png"; image.Save(context.Respo...

System.Drawing.Font: no concept of font weight?

I just noticed that in .net that System.Drawing.Font seems to have no concept of font weight other than FontStyle of normal and bold. I don't have the fine control I had in win32. The WPF framework has font weights, but I'm not using that namespace. ...

System.Drawing: how to control font weight?

I find I can't change the font weight even though I am creating it via win32 pinvoke. I'm using Graphics.DrawString to use the font. I'm stumped and can't find anything on this. [DllImport("gdi32.dll")] static extern IntPtr CreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, uint fdwItalic, uint fdwU...