Game Development Reference
In-Depth Information
int resizedHeight = _texture.Image.Height;
if (_texture.Image.Width > maxDimension ||
_texture.Image.Height > maxDimension)
{
if (_texture.Image.Width > _texture.Image.Height)
{
resizedWidth = maxDimension;
resizedHeight = (int)(_texture.Image.Height *
maxDimension / _texture.Image.Width);
}
else
{
resizedWidth = (int)(_texture.Image.Width *
maxDimension / _texture.Image.Height);
resizedHeight = maxDimension;
}
}
MaterialPreview.Image = new Bitmap(_texture.Image,
resizedWidth,
resizedHeight);
}
private void DisplayInformation()
{
if (_texture.Image != null)
{
this.FileNameLabel.Text = _texture.Name;
this.DimensionsLabel.Text = String.Format(CultureInfo.CurrentCulture,
“{0} x {1}”,
_texture.Image.Size.Width,
_texture.Image.Size.Height);
}
}
private void ToggleSelection()
{
if (_container != null)
_container.PerformSelect(this);
}
Search Nedrilad ::




Custom Search