public void Resize( int width, int height, ImageFilter filter )
{
// resizing dynamic images is not supported
//TODO : Debug.Assert( this._bAutoDelete);
Debug.Assert( this.Depth == 1 );
// reassign buffer to temp image, make sure auto-delete is true
Image temp = new Image();
temp.FromDynamicImage( buffer, width, height, 1, format );
// do not delete[] m_pBuffer! temp will destroy it
// set new dimensions, allocate new buffer
this.width = width;
this.height = height;
size = PixelUtil.GetMemorySize( Width, Height, 1, Format );
buffer = new byte[ size ];
numMipMaps = 0; // Loses precomputed mipmaps
// scale the image from temp into our resized buffer
Scale( temp.GetPixelBox( 0, 0 ), GetPixelBox( 0, 0 ), filter );
}