TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
max
NA
1
10.2k
Silverlight: Threading Problem
Jan 4 2011 1:22 PM
Hi,
I am new to silverlight and I would like to use silverlight for a simple project because of the nice, simple animations.
What I try to do now is to add several images through Drag&Drop to my silverlight application. When I drag for example 10 images to my application I would like it to visualize a preview of the images. I would like to use some kind of fade in effect for the images (the effect lasts about 2s.
So what I tried is the following:
On the drag&drop callback I add the FileInfo to a list of unprocessed images (to avoid processing in the UI thread)
Use a worker thread to load an image from disk, resize it to a size of 150x150pixels and add it to a list of processed images
In the rendering callback I check the list and if there is a processed image I start visualizing it using the animation. The worker thread for image loading in the meantime continues with the next image
My problem now is that the animations are absolutely not smooth. I think the reason is because the worker thread uses a lot of cpu for resizing the next image while a finished image is getting visualized.
However, there seems to be no possibility to reduce the priority of the worker thread to improve things. What I could do is wait until an image is fully visualized before I continue with the next (or wait until all images are finished and then visualize them at once). However this way the visualization would slow down the image processing significantly. After loading each image I would have to wait for 2s before continuing working on the next image. In a multicore environment this would be nonsense,...
Does anyone have an idea how to solve this?
Markus
Reply
Answers (
0
)
How can run Silver light Project?
Silverlight Treeview binding from Domain service