Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / February 2005

Tip: Looking for answers? Try searching our database.

loading images from files?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mustafa Rabie - 14 Feb 2005 20:44 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.