日期:2014-05-17  浏览次数:21089 次

winform求高速缩略图算法!(相机照片质量很高要去速度)
相机的照片提取缩略图 质量太高所以凡是用自带加载的话效率根本上不去 
现在求高手想个办法如何高速生成缩略图(质量可无视)最好是微软打印向导生成缩略图的速度请高手帮帮忙谢谢!

    

------解决方案--------------------
引用:
引用:没看请LZ要求,质量无视的话使用一次插值求代码。。。

        private Bitmap GetThumbnailImage(string s_FilePath, int x, int y)
        {
            using (Bitmap OriginalMap = new Bitmap(s_FilePath))
            {
                Bitmap Map = new Bitmap(x, y, PixelFormat.Format24bppRgb);
                Rectangle Mrect = new Rectangle(0, 0, x, y);
                BitmapData MbmpData = Map.LockBits(Mrect, ImageLockMode.ReadWrite, Map.PixelFormat);

                int x_Width = OriginalMap.Width;
                int y_Height = OriginalMap.Height;
                Rectangle rect = new Rectangle(0, 0, x_Width, y_Height);
                BitmapData bmpData = OriginalMap.LockBits(rect, ImageLockMode.ReadWrite, OriginalMap.PixelFormat);

                int stribe = bmpData.Stride;
                int Mstribe = MbmpData.Stride;

                unsafe
                {
                    try
                    {
                        byte* ptr = (byte*)(bmpData.Scan0);
                        byte* Mptr = (byte*)(MbmpData.Scan0);

                        for (int i = 0; i < y_Height; i++)
                        {
                          &nb