hi i want to make my application skinnable. So i thought of having an XML
file that defines the skin, and then read the skin files and load the images
specified.
I know that in .Net there's image.FromFile() function that loads an image
from file, but can't find it in netCF. So how can i reach that?
Thanks
Mustafa
Darren Shaffer - 14 Feb 2005 21:03 GMT
easiest way to do this is to include the image as an embedded resource in
your CF project
and at runtime use reflection to load it as a bitmap. here's a sample:
pbMap.Image = new
Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("{namespace}.Atlanta.bmp"));
there are other ways to do this and handle other image formats, but this
should get you started.

Signature
Darren Shaffer
Principal Architect
Connected Innovation
> hi i want to make my application skinnable. So i thought of having an XML
> file that defines the skin, and then read the skin files and load the
[quoted text clipped - 4 lines]
> Thanks
> Mustafa
Peter Foot [MVP] - 14 Feb 2005 21:14 GMT
There is an overload for the Bitmap constructor which takes a filename e.g.
[C#]
Image i = new Bitmap("\\My Documents\\skinfile.jpg");
[VB]
Dim i As Image = New Bitmap("\My Documents\Skinfile.jpg")
Peter

Signature
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org
> hi i want to make my application skinnable. So i thought of having an XML
> file that defines the skin, and then read the skin files and load the
[quoted text clipped - 4 lines]
> Thanks
> Mustafa
Mustafa Rabie - 14 Feb 2005 22:46 GMT
thanks peter it worked
> There is an overload for the Bitmap constructor which takes a filename
> e.g.
[quoted text clipped - 15 lines]
>> Thanks
>> Mustafa