473,406 Members | 2,698 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,406 software developers and data experts.

add texts and images on an image - ASP.NET

Please, help me.

I'm using asp.net 2.0.

I have a problem that: I have an weather background image. I need to add texts (like temperature) and 'icon images' (like rainy, sunny ..) on background image. I don't want to use Graphics object to draw text on background.

It looks like this page: http://www.metservice.co.nz/default/...php?alias=home

I'm thinking about using divs on div.
If is there anyway to do it, or a custom control, please show me.

Thanks in advances.
Feb 18 '08 #1
2 1447
DrBunchman
979 Expert 512MB
Hi papillonhn,

This is an ASP forum for classic ASP questions so you should re-post your question in the .NET forum - you'll recieve better technical help over there.

A simple solution would be to use css positioning to acheive this effect. Use an image tag for each position on the map you wish to display a weather symbol and define it's position over the top of the background image using css. You can then change the ImageURL property of each image depending on your weather data. In this example I've defined each image by the nearest town e.g.

[HTML]
<asp:Image ID="imgBG" ImageUrl="MapBackground.gif" runat="server" />
<asp:Image ID="imgQueenstown" CssClass="imgQueenstown" runat="server" />

<asp:Image ID="imgChristchurch" CssClass="imgChristchurch" runat="server" />

<asp:Image ID="imgWellington" CssClass="imgWellington" runat="server" />
[/HTML]

Your css file would hold the position of each image:

[HTML] .imgQueenstown, .imgChristchurch, .imgWellington
{
position:absolute;
}
.imgQueenstown
{
top:100px;
left:20px;
}
.imgChristchurch
{
top:90px;
left:40px;
}
.imgWellington
{
top:80px;
left:50px;
}
[/HTML]

And finally, once you had your weather data you would set the url of each image:

Expand|Select|Wrap|Line Numbers
  1.  Sub DrawWeatherMap() 
  2.  
  3. 'Load your weather data here in whatever format you like (db, xml etc) then set the images e.g
  4.  
  5. imgQueenstown.ImageURL = "Sun.gif"
  6. imgChristchurch.ImageURL = "Cloud.gif"
  7. imgWellington.ImageURL = "Rain.gif"
  8.  
  9. End Sub
  10.  
This is only an example solution and there is probably a more efficient or more powerful way to achieve what you want.

If you have any further questions on this then please re-post this thread on the .NET forum.

Hope this helps,

Dr B
Feb 18 '08 #2
You want to add text/logo image into images, how about adding watermark to images in .NET,I found that by Google ,and I've tried its trial condition, work well for me.

Expand|Select|Wrap|Line Numbers
  1.  
  2. using System.IO;
  3. using System.Drawing.Printing;
  4. using RasterEdge.Imaging;
  5. using RasterEdge.Imaging.Processing;
  6.  
  7. RasterEdgeImaging Image = new RasterEdgeImaging();
  8.  
  9. //Create an instance of Image and load an existing image
  10. using (Image image= Image.LoadImageFromFile(@"C:\1.bmp"));
  11.             {
  12.                 Graphics graphics=new Graphics(image);
  13.                 RasterEdgeImaging.Font font = new RasterEdgeImaging.Font("Times New Roman", 16, FontStyle.Bold);
  14.                 RasterEdgeImaging.Brushes.SolidBrush brush=new RasterEdgeImaging.Brushes.SolidBrush();
  15.                 brush.Color=Color.Black;
  16.                 brush.Opacity=100;
  17.                 image.CreateWatermark("watermark", font, brush, new PointF(image.Width/2, image.Height/2));
  18.                 image.Save(@"C:\1-watermark.bmp");
  19.             }
May 28 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Vinay | last post by:
Hi All: I have a small application that stores images either in the database or as files (depending on the user preference). I'm in the process of providing a web interface to this application....
8
by: Chris Beall | last post by:
I'm struggling with how to handle, on a web page, images that contain text that the user must be able to read. Examples: tombstone photos, photos or scans of historic documents (handwritten or...
3
by: masoud | last post by:
Hello. I have a question. I want make a news board but i dont know how can i put an image for each news,i save images to database and retrive them,then i make a template in datagrid and put a...
2
by: mikeoley | last post by:
Ok I have a Javascript slideshow working. Every image is linked to a another page in the site. Problem is...The link wont refresh to the next link once the second images rollovers in the slideshow....
10
by: Neo Geshel | last post by:
I am seeking to hand-roll my own blog in ASP.NET 2.0 and SQLExpress 2005. Why? Because I can. Because I will gain experience. The one thing that has me stumped at square one is inline images....
61
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the...
1
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project...
1
by: Cerebral Believer | last post by:
Hi folks, I am using the following code for mouse over (roll-overs) in my XHTML code. <a onmouseover="document.getElementById('sitemap').src = '../images/buttons/sitemap_mo.jpg';"...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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 projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.