LoadObjectFromFile Method (original) (raw)

Summary

Loads a raw data object from a file.

Syntax

Parameters

objectFileName
The file name having the data being loaded.

Example

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"; }