Tag Archives: Load

Max SDK Load Bitmap(jpg,png,dds etc.) with .NET(C#)

Max SDK Load Images(jpg,png,dds etc.) with .NET(C#)

This Function is loading textures and showing image height.

/// <summary>
/// This Function is loading textures.
/// </summary>
/// <param name="path">File Location</param>
/// <param name="global">Your IGlobal param.</param>
public void LoadBitmap(IGlobal global,string path)
{
	IBitmap bitmap = global.TheManager.NewBitmap;
	IBitmapInfo bitmapInfo = global.BitmapInfo.Create();
	bitmapInfo.SetName(path);
	global.TheManager.LoadInto(bitmapInfo, bitmap, false);

	MessageBox.Show("Height of image:" + bitmap.Height.ToString());
}