954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Why won't this code work

private Bitmap _picture = new Bitmap(@"<C:\Users\Jack\Documents\Visual Studio 2010\Projects\Animotion1.0\DefaultCharPic.jpg>");


as a datamember to a class?
Can I just not assign Bitmaps as members?

jackabascal
Newbie Poster
13 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 
private Bitmap _picture = new Bitmap(@"<C:\Users\Jack\Documents\Visual Studio 2010\Projects\Animotion1.0\DefaultCharPic.jpg>");

as a datamember to a class? Can I just not assign Bitmaps as members?

Try ...

private Bitmap _picture = new Bitmap(@"C:\Users\Jack\Documents\Visual Studio 2010\Projects\Animotion1.0\DefaultCharPic.jpg", true);

Note the addedtrue argument, and that I dropped the "<" and ">".

Zinderin
Junior Poster in Training
76 posts since Jun 2010
Reputation Points: 22
Solved Threads: 8
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: