LEADTOOLS Medical (Leadtools.MedicalViewer assembly)
LEAD Technologies, Inc

SaveLayout Method

Example 





The stream with the layout to be saved.
Saves the layout to the specified stream.
Syntax
public void SaveLayout( 
   Stream stream
)
'Declaration
 
Public Sub SaveLayout( _
   ByVal stream As Stream _
) 
'Usage
 
Dim instance As MedicalViewer
Dim stream As Stream
 
instance.SaveLayout(stream)
public void SaveLayout( 
   Stream stream
)
 function Leadtools.MedicalViewer.MedicalViewer.SaveLayout( 
   stream 
)
public:
void SaveLayout( 
   Stream^ stream
) 

Parameters

stream
The stream with the layout to be saved.
Example
 
Public Sub MedicorViewerLayoutExample2()
      Dim myForm As MedicalViewerForm = GetMedicalControl()
      Dim medicalViewer As MedicalViewer = myForm.Viewer
      Dim l As Single() = {0.06F, 0.55F}
      Dim t As Single() = {0.75F, 0.75F}
      Dim r As Single() = {0.45F, 0.94F}
      Dim b As Single() = {0.25F, 0.25F}

      '
      ' Add some cells to the viewer
      '
      Dim i As Integer = 0
      Do While i < l.Length
         Dim cell As MedicalViewerMultiCell = New MedicalViewerMultiCell()

         Try
            cell.LayoutPosition = New MedicalViewerLayoutPosition(l(i), t(i), r(i), b(i))
            cell.FitImageToCell = True
            medicalViewer.Cells.Add(cell)
         Catch e As Exception
            MessageBox.Show(e.Message)
         End Try
         i += 1
      Loop

      '
      ' Save the layout
      '
      Dim f As FileInfo = New FileInfo(Path.Combine(LEAD_VARS.ImagesDir, "layout.xml"))
      Dim stream As FileStream = f.Create()

      medicalViewer.SaveLayout(stream)

      '
      ' Reload the cells
      '
      medicalViewer.Cells.Clear()
      stream.Seek(0, SeekOrigin.Begin)
      medicalViewer.LoadLayout(stream)
      '
      ' Show only if created in layout mode
      '
      If medicalViewer.GridMode = False Then
         myForm.ShowDialog()
      End If
   End Sub


Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
public void MedicorViewerLayoutExample2()
{
    MedicalViewerForm myForm = GetMedicalControl();
    MedicalViewer medicalViewer = myForm.Viewer;
    float[] l = { 0.06F, 0.55F };
    float[] t = { 0.75F, 0.75F };
    float[] r = { 0.45F, 0.94F };
    float[] b = { 0.25F, 0.25F };

    //
    // Add some cells to the viewer
    //

    for (int i = 0; i < l.Length; i++)
    {
        MedicalViewerMultiCell cell = new MedicalViewerMultiCell();

        try
        {
            cell.LayoutPosition = new MedicalViewerLayoutPosition(l[i], t[i], r[i], b[i]);
            cell.FitImageToCell = true;
            medicalViewer.Cells.Add(cell);                    
        }
        catch (Exception e)
        {
            MessageBox.Show(e.Message);
        }
    }

    //
    // Save the layout
    //

    FileInfo f = new FileInfo("layout.xml");
    FileStream stream = f.Create();

    medicalViewer.SaveLayout(stream);            

    //
    // Reload the cells
    //

    medicalViewer.Cells.Clear();
    stream.Seek(0, SeekOrigin.Begin);
    medicalViewer.LoadLayout(stream);                                 
    //
    // Show only if created in layout mode
    //

    if (medicalViewer.GridMode == false)
        myForm.ShowDialog();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

MedicalViewer Class
MedicalViewer Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.MedicalViewer requires a Medical Imaging license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features