Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

overlaying images with transparency..

Status
Not open for further replies.

alanshort

Programmer
Jan 23, 2004
5
GB

Hi

I'm tryting to create a weather map. Currently, I have two images, the map and an arrow to show wind direction.

I would like to use C# to load the map image(bmp) as a background then paste the arrow on top of the map.

The arrow is currently a png with transparency.

Is this possible ??

Also, is there an easy way to rotate the arrow image in C#??

cheers
A

 
I'm now using a bmp and I've got this so far which works however, the arrow is not being displayed correctly. It's being resized for some reason... any ideas ??


public static void updateWeatherMap ()
{
Graphics g;
Image weatherMap = Image.FromFile (@"outputMap/_weathermap.bmp");
Bitmap wf3 = (Bitmap)Image.FromFile(@"outputMap/wf3.bmp");

wf3.MakeTransparent(Color.White);

g = Graphics.FromImage(weatherMap);

g.DrawImage(wf3,150,50);

weatherMap.Save(@"outputMap/weathermap1.png",ImageFormat.Png);

g.Dispose();
wf3.Dispose();
weatherMap.Dispose();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top