Archived

This topic is now archived and is closed to further replies.

malpass

Loading a bitmap resource isnt working

Recommended Posts

malpass    122
I made an example app that loads a bitmap from a resource fine
        
public class Form1 : Form
{
	/*
	 * Normal window form stuff here
	 */

	protected override void OnLoad(EventArgs ea)
	{
		pictureBox1.Image = new Bitmap(GetType(),"myBitmapResource.bmp");
	}
	static void Main() {Application.Run(new Form1());}
}

        
And the myBitmapResource.bmp is set to EmbeddedResource on the properties. Now when I did exactly the same on my other app which has multiple classes, it said it couldn't find myBitmapResource.bmp in Form1. You usually get this error if the bitmap isnt set to EmbeddedResource, but mine is. You also get it if the resource isnt in that form, but how can I tell where the image is in order to load it. [edited by - Malpass on May 1, 2003 6:13:40 AM]

Share this post


Link to post
Share on other sites