CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Feb 2009
    Posts
    7

    help on efficient image loading

    I'm writing a program which runs on a specific directory with images, reads them to a Bitmap file and then resize them, and add the resized image to a Bitmap hashmap. The naive code to do this is like this:

    Bitmap bmp = new Bitmap(flFileArray[i].FullName);
    Bitmap bmp2 = new Bitmap(bmp, (int)(nudWidth.Value / nudNumOfPics.Value),
    (int)(nudHight.Value / nudNumOfPics.Value));

    m_hshBitmapArray.Add(bmp2, GetAvgPixelVal(bmp2));

    It's quite simple, but i'm wondering if there is a faster way to do this. Can anyone think of something?

    BTW, Im coding on VS2008, but it wouldn't hurt getting an answer for VS 2005.
    Last edited by blabla2006; February 7th, 2009 at 02:00 PM. Reason: Adding Framework version

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured