Recently in the photo album feature encountered a problem, is to load the picture and then zoom in, feel a little card. The picture may be a bit large, so consider using thumbnails to implement it.
That is, in the query out of an album picture, a page showing dozens of, the dozens of pictures with thumbnails to show, see believe that when the QQ photo album sample loading images to enlarge pull pictures related information. The technology used is the image compression function. Now the functionality has been implemented to see the code.
[CSharp] View plain copy print? using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.drawing.imaging; using system.io; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public form1 () { initializecomponent (); } &NBSP;&NBSP;&NBSP;&NBsp; private void button1_click (Object sender, eventargs e) { string pathperc = @ "D:\ 0046620140807150650cin.jpg "; string source = @ "G:\0046620140807150650cin.jpg"; if (! File.exists (PATHPERC)) { File.create (PATHPERC). Close (); } else { file.delete (PATHPERC); File.create (PATHPERC). Close (); } getthumimage (Source, 18, 3, &NBSP;PATHPERC); } #region getThumImage /**/ /// <summary> /// generate thumbnails /// </summary> /// <param name= "SourceFile" > Original picture file </param> /// <param name= "Quality" > Quality compression ratio </param> /// <param name= "multiple" > shrinkage ratio </param> /// <param name= "outputfile" > Output filename </param> /// <returns> Success Returns TRUE, Failure returns false</returns > public static bool getthumimage (string sourcefile, long quality,