public void LoadObjectFromFile(
string objectFileName
)
objectFileName
The file name having the data being loaded.
This method will load the raw data and create a 3D object.
To save the object data, use the SaveObjectToFile method.
This format is not a universal format; the toolkit saves in the generated file the required information to load what the toolkit needs in order to reconstruct the 3D object. User does not need to set any related properties to this save and load option.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.MedicalViewer;
using Leadtools.Medical3D;
public void Medical3DControlExample()
{
MainForm1 form = new MainForm1();
form.ShowDialog();
}
// MainForm1 will be the owner of the medical viewer control.
class MainForm1 : Form
{
private Medical3DControl _medical3DControl;
public MainForm1()
{
_medical3DControl = new Medical3DControl();
this.SizeChanged += new EventHandler(MainForm1_SizeChanged);
this.FormClosing += new FormClosingEventHandler(MainForm1_FormClosing);
_medical3DControl.ObjectsContainer.Objects.Add(new Medical3DObject());
string fileName = Path.Combine(LEAD_VARS.ImagesDir, @"Images\CT_PelvisRawData");
_medical3DControl.ObjectsContainer.Objects[0].LoadObjectFromFile(fileName);
Controls.Add(_medical3DControl);
}
void MainForm1_FormClosing(object sender, FormClosingEventArgs e)
{
_medical3DControl.Dispose();
}
void MainForm1_SizeChanged(object sender, EventArgs e)
{
if (_medical3DControl != null)
_medical3DControl.Size = new Size(this.ClientRectangle.Right, this.ClientRectangle.Bottom);
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}