Image Manipulations (how to set legends)

Discussion in 'ASP .Net' started by Stan Sainte-Rose, Oct 2, 2004.

  1. 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
     
    Stan Sainte-Rose, Oct 2, 2004
    #1
    1. Advertising

  2. Stan Sainte-Rose

    jongalloway Guest

    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
     
    jongalloway, Oct 2, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lorn

    String manipulations

    Lorn, May 28, 2005, in forum: Python
    Replies:
    5
    Views:
    336
  2. PyPK

    Pixel Manipulations

    PyPK, Sep 28, 2005, in forum: Python
    Replies:
    1
    Views:
    326
    Terry Reedy
    Sep 28, 2005
  3. PyPK

    Pixel Manipulations

    PyPK, Sep 28, 2005, in forum: C++
    Replies:
    6
    Views:
    336
    mlimber
    Sep 29, 2005
  4. George Steward

    Gallery legends

    George Steward, Jul 18, 2003, in forum: Javascript
    Replies:
    1
    Views:
    270
    Peter
    Jul 19, 2003
  5. Koos Pol

    GD::Graph - Fitting wide legends?

    Koos Pol, Jul 6, 2004, in forum: Perl Misc
    Replies:
    0
    Views:
    286
    Koos Pol
    Jul 6, 2004
Loading...

Share This Page