how to draw next image with labels in rectangles? thanks for help:
-
+1: I'm gonna need to do this fairly soon too, so I'm interested in the answers. – Jackson Pope May 10 '11 at 20:20
2 Answers
Use the different classes in the System.Drawing
namespace.
Alternatively, use one of the many drawing libraries around.
Note:
The documentation on MSDN gives the following warning:
Classes within the System.Drawing namespace are not supported for use within a Windows or ASP.NET service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions. For a supported alternative, see Windows Imaging Components.
However, I and others who have done so have not found problems. Even MSDN magazine suggests it...
-
-
@Jackson Pope - You don't. You simply download an image, the image gets trapped on the server and an in-memory bitmap is returned. – Erik Funkenbusch May 10 '11 at 20:25
-
@Jackson: You can just use an Image control, and render an image using the classes in System.Drawing. – mellamokb May 10 '11 at 20:27
-
Thanks to both @Oded and @Mystere, that info will definitely come in handy in a week or so! – Jackson Pope May 10 '11 at 20:27
There's a very good, detailed article at the 4guysfromrolla web site. I used this the first time I needed to do such a thing, and I still use the same pattern.
https://web.archive.org/web/20211020111734/https://www.4guysfromrolla.com/articles/042209-1.aspx
This one is fairly good as well, but nowhere near as well-explained as the first one. http://blogs.sitepoint.com/generating-asp-net-images-fly/

- 72,686
- 18
- 132
- 173