Axiom.Media.Image.Resize C# (CSharp) Method

Resize() public method

Resize a 2D image, applying the appropriate filter.
public Resize ( int width, int height, ImageFilter filter ) : void
width int
height int
filter ImageFilter
return void
		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 );
		}

Same methods

Image::Resize ( int width, int height ) : void