473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Image Manipulations (how to set legends)

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

Nov 18 '05 #1
1 1365
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...=407&site=1727
http://www.codeproject.com/aspnet/as...b_graphics.asp
http://www.syncfusion.com/FAQ/WinForms/FAQ_c3c.asp
http://www.bobpowell.net/faqmain.htm
- Jon
http://weblogs.asp.net/jgalloway

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michele Petrazzo | last post by:
I want to create a simple image editor (with wxPython) for my application. Now I'm able to zoom, draw with a pen, insert a text into the loaded image, and undo changes (for this I reload the image...
2
by: Eric McDaniel | last post by:
I am trying to read in a bunch of images and manipulate them using Image::Magick, then display them using Tk::Photo. I would like to do this without creating a temp file for each image, since there...
10
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
2
by: Daves | last post by:
hi, I've been using the system.drawing.image.GetThumnailImage() to create a thumbnail from an image a user uploads to web. I save the result as a gif image. Works fine except that the color...
6
by: Guch | last post by:
I'll swictch from Matlab to C++. So I want to find a matrix library of C++, Whitch can process images conveniently as Matlab does. I've googled, and found that Blitz++ and MTL are popular and...
2
by: rfox | last post by:
I have a page with a couple of forms on it that have a light background color. The form boxes have legends for the title of each box. All is well with the world until I view the page in IE. In...
3
by: MrNobody | last post by:
I was wondering if anyone experienced with .NET's image/drawing tools would know of a way to replace selective colors in images, like say a piant bucket tool in Microsoft Paint? Or even better...
1
by: nitheshsalian | last post by:
can anyone give me the code snippet to open a image file using c/c++ in windows platform??? i want to store a image file in an array and later do some manipulations on it... i want to use the...
0
by: norseman | last post by:
Daniel de Sousa Barros wrote: ================================================ Click Start/settings/control panel/system/advanced/settings(in \ performance area)/advanced/change set System...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.