Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Resource Build Action not working
1 replies. Latest Post by robhouweling on July 26, 2008.
(0)
chemist
Member
251 points
53 Posts
07-26-2008 6:57 AM |
Hello Everybody,
I've some images in .png form. I added these images to a folder and set their build action to Resource. The problem i get is that when i debug the SL project, I got the exception saying:
Invalid URI: A port was expected because of there is a colon (':') present but the port could not be parsed.
pack://application:,,/Folder/Img0{0}.png"
the first parameter {0} is replaced with the count of image. Image names are
Img00, Img01, img02 and so on. What I'm missing here? please help me in this regard.
Thanks
robhouwe...
Contributor
3158 points
540 Posts
07-26-2008 7:01 AM |
When you want to use an image that is build as a resource, its included in the XAP file and you can use it like you would when the image was in the folder the XAP is in.
Uri imageUri = new Uri(String.Format("Img0{0}.png", counter), UriKind.Relative);
(If this has answered your question, please click on mark as answer on this post)Cheers!Rob Houweling