This project is read-only.

Problem in appending images for AlphaImageButton and AlphaPictureBox

Feb 21, 2009 at 8:05 AM
I had a problem as follows:
when i tryed to append a image which was different from the images that the project had,for example,in AlphaFormTest,
 bgPixBox.Image = AlphaImage.CreateFromResource("AlphaMobileControls.TestApp.Resources.Wallpaper.jpg");
I change the "Resources.Wallpaper.jpg" to "Resources.1.jpg",and 1.jpg was appended to the File Resources by me.But the error was just here:
In AlphaImage.cs
public static AlphaImage CreateFromResource(string imageResourceName)
   MemoryStream stream =
   return CreateFromStream(stream);

the "stream "= null.

I knew maybe the error was that the wrong image path of the "1.jpg" image made.So who can tell me how to append the images to the file Resources
or the right way I can do .
Thank you !!
Jun 12, 2009 at 4:30 PM

beidaochuan, did you manage to solve the problem you're having? as I currently am also having the same problem and would like to know how you managed to go around it.





Jun 17, 2009 at 1:30 PM

See the probelm faced by you is the one when the Imageis not found in the resource folder, Do the following things in order to see if the Imgae Displays up...

1. Once you have added image to Resource Folder (or Any other Folder Name you have)

2. Check the Properites Section by clicking on The Image...

3. Here Check the uild Action Switch the Build Action to Embedded Resource...


I think this may solve the issue in case not report me Back...

Mar 21, 2010 at 4:10 PM

As yrameshrao wrote:

1) Check if pic added to resource folder

2) choose pic  and see it's properties

3) find in properties "Build Action"

4) set for "Build Action" - Embedded Resources.

5) if you not sure what resources name write in  this function AlphaImage.CreateFromResource("???????");

6)  for testing what embedded resources you have add inside CreateFromResource("???????")

 this :  string[] resources = Assembly.GetCallingAssembly().GetManifestResourceNames();

in debug mode stop on this line and see what resources you have and their name.