The question can be split in two parts: 1) how to store/retrieve images to/from database? 2) how to resize images (this is called
resampling)? The basic answer is: you should take the two separately. Retrieve an image, resample it (you can do it on the fly, without storing images in temporary files), store it again.
As to the first part, honestly, it's not good to answer a question which has been asked and answered so many times:
http://www.codeproject.com/search.aspx?q=database+%28image+OR+images+OR+bitmap+OR+bitmaps%29+C%23&doctypeid=5[
^].
As to resampling: you can use
System.Drawing
. Please see my past answers for further detail:
resize image in vb.net[
^],
Read Big Tiff and JPEG files (>(23000 x 23000) pix) in a stream. And display part of it to the screen in realtime.[
^].
[EDIT]
I did not want to say that storing resample images back in the database is a must. You can store additional versions of images, of smaller sizes, or you can not change the database at all but resample images on the fly on each request, only when you need to display them.
—SA