How to play large no. Of GIF images in WPF, C#? - c#

I need some help in Making a slideshow type application in WPF. Problem is, Image that needs to be used in this application are .gif, for which i think so we dont have any control in WPF.
Does any one have any idea of how to play those images without impacting any kind of performance? Also the machine in which i need to use this application is windows XP, that means the we can only use up to .net 4.0.
What I have tried:
I have tried many examples find over this page, but the memory it consumes is too high as i need to change image more often.
Dll's that i have tried are
wpfanimatedgif:- It has some serious memory leak issues.
also i have tried
XamlAnimatedGif:- it works fine while running on .net 4.5 machine. but was unable to display any image while on .net 4.0 machine.

Related

Troubles of performance related to WPF control hosted in WinForms

We have a very complex software primarily written using .NET WinForms in C#. Many people have contributed to it. One such contribution was the addition of a Windows Presentation Foundation (WPF) control hosted in Win Forms. The said control is considered a common control and used in many places in the application.
Everything was working fine till a few days ago when we started seeing inordinate delay in launching the application. The application used to launch in less than 5 minutes, but now takes 20 minutes to launch.
We have been analyzing the situation but have found it very hard to pin down the real issue. We have seen that our misbehaving common control that is used at multiple places, eventually calls the following framework functions:
The time taken by the system functions to perform their duties is shown in the picture above. The system functions take around 1.5 minutes each time the common control is initialized. We use the common control at least 8 times in our application. So, a total of 12 minutes.
Has anyone else seen such issues with WPF controls hosted on WinForms?
Any help would be appreciated.
EDIT:
There is an issue with C# Dictionary we use. Getting rid of it by using a List<> solves the delay issue. Microsoft has reproduced the issue at their end. They are working on it.
Maybe, our application took C# Dictionary to the edge ;)
Thank you all for providing your inputs.
This is likely to be the Initialization of the WPF control rather than something to do with the ElementHost or the fact that it's hosted within WinForms.
Without seeing the code for the WPF UserControl its hard to tell you what that might be but I would say that the interop of WPF / WinForms is certainly a red herring.
You can try using the Ngen:
The Native Image Generator (Ngen.exe)is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead of using the just-in-time (JIT) compiler to compile the original assembly.
If the assemblies of project will be compiled with help of Ngen, there is no need to run every time JIT-compiler before starting application and loading metadata of using assemblies.
Ngen will find all of the static dependence of the main assembly and compile them all in a low-level images. These images will be stored in cache of assemblies (GAC), thereby it is possible to reduce application load time.

Windows Embedded wpf application

I have build a WPF media player application in c# .Net 4.0. I would like to take this WPF application and put it on a Windows Embedded operating system. This would take out all the things I don't need and just make a simple power on and my application loads. I know there will be a lot of work in order to make this happen and I'm just wondering if someone can point me to a good starting location. I've looked around a lot but haven't found a good tutorial on how to go about doing this or what version of windows embedded I would need etc. Any help would be greatly appreciated.
Thanks!
if you are using Windows Embedded 8, it's basically full windows with lockdown features, thus any application that can run on normal windows will be able to run on it

Accessing Skydrive services without a browser [XNA Game]

We have a game that works on XNA on Windows Phone 7.1 and 8.
We want to add Cloud saving and loading of savegames like can be found on many different apps on android.
After i spent two weeks migrating my game from pure "XNA" to "XNA and XAML" i noticed a performance drop of almost 50%, so i decided that i need a different approach that didn't require a webbrowser control.
I was thinking of using REST calls via HTTPWebRequest like explained here:
http://msdn.microsoft.com/en-us/library/aa446517.aspx
Is this my only choice and or is there a smarter way to do it?

Why WPF application process occupy more memory?

I am developing an application using WPF. I am using a lot of Grid layouts. In my application, we use five services to communicate. All works fine. Sometimes, the application slowed way down so I checked task manager to see the memory usage. Then I saw 1.285 GB memory occupied by the application process.
I am using Windows 7 operating system. My Application developed in wpf 4.0 version. In that we use WCF , WIF etc for communication. I also used Images. Can any one give the solution why application process occupies more memory?
All the images are small images.Actually my application occupies nearly 110 MB.But sometimes it occupies 1.238 GB memory.I am not using Large images in my application.
There's no magic bullet answer here for you, it really depends on what you are doing in your application.
Its time to jump into the world of using a profiler and figuring out what is going on in your own app.

How to speed up the initialization of a .NET client application (Windows Forms or WPF)?

Sometimes I create some quick personal projects using C# with Windows Forms or WPF. I have noticed that managed applications can take 2x or 3x times longer to start compared with native applications.
I have written a "Quick Notes" application, however it isn't very "quick". :-(
What are some techniques to speed up the initialization of Windows Forms/WPF applications?
Check out NGen
Also, if you are loading lots of data on load, move it to another thread and show an indicator or something (while it's loading) so at least the form pops up quickly, even if it takes a little longer for the actual data to load.
.NET 3.5 SP1 does tend to make start up a little quicker. Also see a series of blog posts on putting up a splash screen (in native C++) while starting the WPF application at the Logos Blog.
.NET 3.5 SP1 also now includes the ability to create a fast SplashScreen without using C++
You might also want to consider moving processing off to worker threads. When your app starts load the root UI, but not the data - rather load the data async (and create pad windows etc. as each data item comes in).
.NET applications made for .NET 3.0 or later work much better on newer versions of Windows, Windows Vista, Windows 7, etc. I think in a few years time the difference between managed and unmanaged code in terms of performance will unnoticeable.

Categories

Resources