private void ShowTexture( )
{
// check generator
if ( textureGenerator == null )
{
pictureBox.Image = null;
return;
}
int width = pictureBox.ClientRectangle.Width;
int height = pictureBox.ClientRectangle.Height;
// generate texture
float[,] texture = textureGenerator.Generate( width, height );
// create bitmap from the texture
Bitmap image = TextureTools.ToBitmap( texture );
// show image
pictureBox.Image = image;
}