المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : very fast image conversion from jpg to bmp in c#



C# Programming
01-27-2010, 01:30 PM
Hi all developers,

I have spent a lot of time to find a fast way for converting a stream of jpg images to bitmap format in c# (to use in a n image processing unit in my application). The conversion in my code is done as follows:

using (MemoryStream ms = new MemoryStream(imageBytes))
{
this.bqi.Bitmap = new Bitmap(ms);
}

in these code lines, imageBytes contains jpg image data ready to convert to bitmap format. These images are coming in from an IP camera as a web server. The frame rate is 15 frames per second, and converting 15 frames per second to Bitmap in this way takes too much time of CPU and the application is almost unable to do any other job when preview is on.

Is there any workaround for this conversion without need to much cpu usage? Is there any solution on using directshow for converting jpg to bmp on gpu?

any suggestions appreciated.

thanks in advance

----------
Eric(M.M)