hi ,
i have been in
developing application in smartphone using c# .. i am using visual
studio 2005 .... for my application i have loaded the resoueces using
the following code ...
Stream s ;
Bitmap img_btYellow;
s = this.GetType().Assembly.GetManifestResourceStream("Widgets.res.avblue.png");
img_btYellow = new Bitmap(s);
s.Close();
i
have loaded 8 '.png' images through the above code using the same
stream ' s ' . the application is running fine in emulator .... but it
is showing out of memory exception in the exe created inside the bin
folder ... even i tried using singleton object for all the classes ,
that i have used .. but it s still showing the same exception .. could
anyone help me in resolving this issue ..

regarding memory exception
JoshKorn
You have to dispose of all these bitmaps as soon as you done using the. Also keep in mind bitmaps are expanded into memory potentially taking huge amounts of RAM. Small 100K JPEG or PNG can be expanded to megabytes in RAM. Considering devices are limited to 32 MB (~25 available for application) of virtual RAM that would lead to OOM exception very quickly. Consider scaling these bitmaps down to, say. VGA resolution to save RAM.
Bruno Ribeiro
You should only dispose of something you no longer need. If you dispose of bitmap you would have to recreate it if it's needed again.
If it's a game tiny QVGA (or at best VGA) bitmaps should be used. Scale down all your bitmaps to that resolution to save memory and improve performance.
As to flickering, search for "double buffering", that’s the technique you’d need to use. It’s been discussed quite a few times.
is98
so there is no other way than double buffering in order to control flickering. wheather the .NET compact frameWork is bilt upon double buffering . if so how to implement double buffering in our application
Jason Jaegers
Moving to Smart Devices General forum where it has got better chances of being answered.
-Thanks,
Mohit
Aleniko29139
i had even tried with Double buffering concept . still the screen is flickering in the emulator .
thanks
sadiq
Corby111
thanks
sadiq
Hoodwinked
thanks sadiq
Troy Lundin
There are many game samples available, go through them and see how they deal with this issue, then do the same.