Advice on Images and CF2 Please???

I

iKiLL

Hi All,



I am new to .Net and Compact Framework. So I have a really basic question
for you all.



I am building an application in C# for Windows Mobile 5.0 in VS2005 CF2.0



I would like this application to have some customizable features with out
having to recompile.



In particular this like images and Logos to be changeable.



Bearing in mind I am writing for the PDA platform



My Question:

1. Is this realistic to load images into the application. Rather
than compile them in.

2. What is the best/fastest way to load images into an application
from a folder.



You see what I was thinking was having a folder in the application directory
to hold the images, that have specific predefined names and sizes in a
certain format. Then on load the application can pick them up. This way the
application can be Branded for an company that uses it.



Any suggestions are welcome.



Thanks,

ink
 
N

Norman Rericha

If you are trying to avoid a recompile, it makes sence to use a fixed
directory path and fixed names. To allow for skins or customization I
found that using the Directory name to identify the "skins" allowed for
easy maintence.

Embedding the images into a DLL or the application is possible, but the
unpack time is fairly high. Also you won't be able to change the
images without a recompile.

Fastest way to load the images is on demand. Instead of trying to load
them all at once in the beginning, load them when they are needed for
display.

I was able to accomplish fairly robust image management by creating a
DLL that stored all the images after they were loaded the first time
and then allowing object to use them as needed. If a needed image
wasn't loaded yet then it would load, however if the image was used
before it would be returned.

I have spent lots of time on this problem, and have seen and created
many different solutions. Best advice is to just experiment with what
you have and see which works best for you.
 
I

iKiLL

Thank you very much for your comments Norman.

That is exactly the advice i was looking for.

Would you be able to post an example of your object that held loaded images,
and how you tested to see if they were loaded before reloading them again.

Many thanks
ink
 
G

Guest

That very basic programming. Read the file into a Bitmap object using the
ctor that takes a path. If the object isn't null, you've already loaded it.
 
I

iKiLL

Thanks ctacke




That very basic programming. Read the file into a Bitmap object using the
ctor that takes a path. If the object isn't null, you've already loaded
it.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top