日期:2014-05-17 浏览次数:21137 次
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