Click here to Skip to main content
15,894,539 members
Home / Discussions / C#
   

C#

 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
harold aptroot26-Jan-10 3:50
harold aptroot26-Jan-10 3:50 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Natza Mitzi26-Jan-10 4:58
Natza Mitzi26-Jan-10 4:58 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
harold aptroot26-Jan-10 5:30
harold aptroot26-Jan-10 5:30 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Natza Mitzi26-Jan-10 8:13
Natza Mitzi26-Jan-10 8:13 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
harold aptroot26-Jan-10 8:19
harold aptroot26-Jan-10 8:19 
AnswerRe: very fast image conversion from jpg to bmp in c# Pin
Luc Pattyn26-Jan-10 4:05
sitebuilderLuc Pattyn26-Jan-10 4:05 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Mohammad Mahdipour26-Jan-10 18:31
Mohammad Mahdipour26-Jan-10 18:31 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Luc Pattyn27-Jan-10 12:47
sitebuilderLuc Pattyn27-Jan-10 12:47 
Hi,

I ran a couple of experiments, with a set of 100 JPEG images, each larger than 2200*1800 ("original").
I also converted them to a set of 1600*1200 ("medium") and another set of 800*600 ("small").

The test consisted of animating those images to a PictureBox as fast as possible, basically with this code:
foreach (string s in list) {
    Image oldImage=pb.Image;
    if (oldImage!=null) oldImage.Dispose();
    using (FileStream stream=File.Open(s, FileMode.Open)) {
        Bitmap bm=new Bitmap(stream);
        pb.Image=bm;
        Application.DoEvents(); // update the PictureBox
    }
}


And the time required on a laptop (with an Intel 2.4GHz Core2 Duo) was 18/8/2 seconds for original/medium/small images, telling me the image size (in pixels) is of utmost importance. So, if at all possible, I recommend you tell your camera or webcam to output lower-resolution images.

BTW: the same experiment with bitmap images (*.BMP) is terribly slow, due to the size of the files involved.

Smile | :)

Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
[The QA section does it automatically now, I hope we soon get it on regular forums as well]


AnswerRe: very fast image conversion from jpg to bmp in c# [modified] Pin
The Zetta26-Jan-10 6:07
The Zetta26-Jan-10 6:07 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
Ennis Ray Lynch, Jr.26-Jan-10 10:48
Ennis Ray Lynch, Jr.26-Jan-10 10:48 
GeneralRe: very fast image conversion from jpg to bmp in c# Pin
The Zetta27-Jan-10 5:30
The Zetta27-Jan-10 5:30 
AnswerRe: very fast image conversion from jpg to bmp in c# Pin
Mohammad Mahdipour26-Jan-10 18:37
Mohammad Mahdipour26-Jan-10 18:37 
QuestionBasic SQL connection through classes Pin
Steve-Co26-Jan-10 0:09
Steve-Co26-Jan-10 0:09 
AnswerRe: Basic SQL connection through classes Pin
#realJSOP26-Jan-10 0:12
mve#realJSOP26-Jan-10 0:12 
GeneralRe: Basic SQL connection through classes Pin
Steve-Co26-Jan-10 0:24
Steve-Co26-Jan-10 0:24 
GeneralRe: Basic SQL connection through classes Pin
J4amieC26-Jan-10 0:41
J4amieC26-Jan-10 0:41 
AnswerRe: Basic SQL connection through classes Pin
i.j.russell26-Jan-10 0:57
i.j.russell26-Jan-10 0:57 
GeneralRe: Basic SQL connection through classes Pin
Not Active26-Jan-10 1:51
mentorNot Active26-Jan-10 1:51 
GeneralRe: Basic SQL connection through classes Pin
PIEBALDconsult26-Jan-10 4:11
mvePIEBALDconsult26-Jan-10 4:11 
GeneralRe: Basic SQL connection through classes Pin
#realJSOP26-Jan-10 6:45
mve#realJSOP26-Jan-10 6:45 
GeneralRe: Basic SQL connection through classes Pin
PIEBALDconsult26-Jan-10 6:52
mvePIEBALDconsult26-Jan-10 6:52 
AnswerRe: Basic SQL connection through classes Pin
kevinnicol26-Jan-10 2:39
kevinnicol26-Jan-10 2:39 
AnswerRe: Basic SQL connection through classes Pin
SilimSayo27-Jan-10 3:11
SilimSayo27-Jan-10 3:11 
QuestionA theoretical problem when coding a BUSY TCP/UDP server [modified] Pin
SimpleData25-Jan-10 23:03
SimpleData25-Jan-10 23:03 
AnswerRe: A theoratical problem when coding a BUSY TCP/UDP server Pin
harold aptroot25-Jan-10 23:27
harold aptroot25-Jan-10 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.