loading images to ram

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello...

I am new to C#. My requirement is that, I will receive over 100s of images
from the network to local machine and display these images on an image viewer
one by one on mouse scroll. To improve the performance, I want these images
to reside on the RAM instead of the hard disk. How do I load the images to
the ram and access it to improve my performance.
 
=?Utf-8?B?bXJhag==?= said:
I am new to C#. My requirement is that, I will receive over 100s of
images from the network to local machine and display these images on
an image viewer one by one on mouse scroll. To improve the
performance, I want these images to reside on the RAM instead of the
hard disk. How do I load the images to the ram and access it to
improve my performance.

Just load them into an image component and cache them. Or if you are doing the drawing directly, you
can store them in byte arrays or streams.



--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
 
See the GDI+ FAQ for articles that may help you to understand the
shortcomings of such a scheme.

Images take up a lot of space so uless you're using thumbnails you could be
in for a lot of pain trying to store large amounts of images in RAM.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Hi mraj,
As your goal is performance, you must keep an open eye on the number of
images and total size you are going to load in memory first.

If you think you plan it well, you can use the BitMap class to load the
Image from file and you can combine in with MemoryStream object to direct it
in a memory stream of bytes.

Mu advice to not load them all in memory, at least load couples of them and
drop them to get a new couple when user scrolls a page.

Hope that work with you, good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top