You are making a thumbnail? Why not use the framework? This is my code:
public static Image GetThumbnailImage(Image image, int width, int height)
{
Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);
return image.GetThumbnailImage(width, height, myCallback, IntPtr.Zero);
}
private static bool ThumbnailCallback()
{
return false;
}