PictureBox White Background

I need it gone, but cant figure it out

Page 1 of 1

2 Replies - 4178 Views - Last Post: 09 February 2009 - 04:19 PM Rate Topic: -----

#1 painkiller102  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 15
  • View blog
  • Posts: 281
  • Joined: 27-February 08

PictureBox White Background

Posted 09 February 2009 - 04:06 PM

So far my program is basic with just two pictureboxes and a label. I have several images that will go into the pictureboxes, however all of them have that same annoying white background. I have tried a couple ways to get rid of that white background but have had no success. I have even photoshopped all images into .gif with a transparent background, but C# seems to be recreating the white background instead of the transparent background. So far my code is this:
	public partial class game : Form
	{
		private Image bat = Image.FromFile("F:\\C#\\Projects\\Final Images\\bat normal.gif");
		private void game_Load(object sender, EventArgs e)
		{
			baseballControl.Image = bat;
		}
	}
}

i know its not much, but the idea is all there. I have also tried to use the form transparency key, however it makes form completely transparent so all white spaces would show the desktop or anything else behind it, not the forms background. Any help is greatly appreciated and thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: PictureBox White Background

#2 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: PictureBox White Background

Posted 09 February 2009 - 04:14 PM

Use the PNG image format. It is the format i always use when i need alpha channels (transparency) in my images. Then, just go into photoshop and erase the white areas and re-save it. Also make the background color of your picturebox transparent.

This post has been edited by jacobjordan: 09 February 2009 - 04:15 PM

Was This Post Helpful? 0
  • +
  • -

#3 painkiller102  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 15
  • View blog
  • Posts: 281
  • Joined: 27-February 08

Re: PictureBox White Background

Posted 09 February 2009 - 04:19 PM

Thanks bunches! all it needed was for the backcolor to be set to transparent! And .gif images still work for the transparency too! Thanks again!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1