Класс EcgRenderingSettings
 
            
                В этом разделе
            
            Содержит настройки рендеринга для DICOM-страницы с электрокардиограммой.
            
            
Объектная модель
Синтаксис
Пример
Вот C#/VB.NET код, который демонстрирует, как загрузить электрокардиограмму из DICOM-файла и отрендерить изображение электрокардиограммы с пользовательскими настройками рендеринга электрокардиограммы.
    
	
	    
	    
''' <summary>
''' Returns the electrocardiogram image with custom electrocardiogram settings.
''' </summary>
''' <param name="filePath">A path to a DICOM file with electrocardiogram.</param>
''' <returns>
''' The image with custom electrocardiogram settings.
''' </returns>
Friend Shared Function GetEcgImageWithCustomEcgSettings(filePath As String) As Vintasoft.Imaging.VintasoftImage
    ' create custom electrocardiogram settings
    Dim renderingSettings As New Vintasoft.Imaging.Codecs.Decoders.EcgRenderingSettings()
    renderingSettings.BackgroundColor = System.Drawing.Color.Black
    renderingSettings.MajorGridColor = System.Drawing.Color.Gray
    renderingSettings.MinorGridColor = System.Drawing.Color.FromArgb(96, 96, 96)
    renderingSettings.SignalColor = System.Drawing.Color.Lime
    renderingSettings.LegendFontColor = System.Drawing.Color.Lime
    ' open DICOM file
    Using stream As System.IO.Stream = System.IO.File.OpenRead(filePath)
        ' create decoder for DICOM image
        Using decoder As New Vintasoft.Imaging.Codecs.Decoders.DicomDecoder(stream)
            ' return image with custom electrocardiogram settings
            Return decoder.GetImage(0, renderingSettings)
        End Using
    End Using
End Function
	     
	 
 
    
	
	    
	    
/// <summary>
/// Returns the electrocardiogram image with custom electrocardiogram settings.
/// </summary>
/// <param name="filePath">A path to a DICOM file with electrocardiogram.</param>
/// <returns>
/// The image with custom electrocardiogram settings.
/// </returns>
internal static Vintasoft.Imaging.VintasoftImage GetEcgImageWithCustomEcgSettings(string filePath)
{
    // create custom electrocardiogram settings
    Vintasoft.Imaging.Codecs.Decoders.EcgRenderingSettings renderingSettings = new Vintasoft.Imaging.Codecs.Decoders.EcgRenderingSettings();
    renderingSettings.BackgroundColor = System.Drawing.Color.Black;
    renderingSettings.MajorGridColor = System.Drawing.Color.Gray;
    renderingSettings.MinorGridColor = System.Drawing.Color.FromArgb(96, 96, 96);
    renderingSettings.SignalColor = System.Drawing.Color.Lime;
    renderingSettings.LegendFontColor = System.Drawing.Color.Lime;
    // open DICOM file
    using (System.IO.Stream stream = System.IO.File.OpenRead(filePath))
    {
        // create decoder for DICOM image
        using (Vintasoft.Imaging.Codecs.Decoders.DicomDecoder decoder = new Vintasoft.Imaging.Codecs.Decoders.DicomDecoder(stream))
        {
            // return image with custom electrocardiogram settings
            return decoder.GetImage(0, renderingSettings);
        }
    }
}
	     
	 
 
 
Иерархия наследования
System.Object
   Vintasoft.Imaging.Codecs.Decoders.RenderingSettings
      Vintasoft.Imaging.Codecs.Decoders.EcgRenderingSettings
 
Требования
Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5
 
Смотрите также