Image Manipulations (how to set legends)

  • Thread starter Stan Sainte-Rose
  • Start date
S

Stan Sainte-Rose

Hi,

I need to set several legends to an bmp Image.
The legends must be set all around of the image (each 30 degrees).
I really need your help about this topic.
The best would be to get a vb solution :)

Stan
 
J

jongalloway

Stan -

Here's an example. The one thing I think you'll need to play with is
the positioning of the point (last parameter of the DrawString
function). If you saved this as Image.aspx, you could display it on
another page with <img src="image.aspx?Legend=Sample">.

<%@ Page Language="VB" ContentType="image/jpeg" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Text" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>

<%
Response.Clear( )
Dim Legend as String

If Request.QueryString("Legend") = Nothing Then
Legend = ""
Else
Legend = Request.QueryString("Legend")
End If

Dim bmp as Bitmap = Image.FromFile("Input.bmp")
Dim g as Graphics = Graphics.FromImage(bmp)

g.RotateTransform(30);
g.DrawString(Legend, _
New Font("Arial", 12, FontStyle.italic), _
SystemBrushes.WindowText, New PointF(100,100))
g.ResetTransform();

bmp.Save(Response.OutputStream, ImageFormat.Jpeg)
g.Dispose( )
bmp.Dispose( )
Response.End( )

%>

References:
http://www.wwwcoder.com/main/Default.aspx?tabid=68&mid=407&site=1727
http://www.codeproject.com/aspnet/aspnet_web_graphics.asp
http://www.syncfusion.com/FAQ/WinForms/FAQ_c3c.asp
http://www.bobpowell.net/faqmain.htm
- Jon
http://weblogs.asp.net/jgalloway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top