VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.Codecs.Decoders Namespace / EcgRenderingSettings Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
EcgRenderingSettings Class
In This Topic
Contains rendering settings for DICOM electrocardiogram page.
Object Model
PaddingF RenderingSettings Resolution ColorBase EcgRenderingSettings
Syntax
'Declaration

Public Class EcgRenderingSettings
   Inherits RenderingSettings

public class EcgRenderingSettings : RenderingSettings

Example

This C#/VB.NET code shows how to load electrocardiogram from DICOM file and render electrocardiogram image with custom ECG rendering settings.


''' <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);
        }
    }
}

Inheritance Hierarchy

System.Object
   Vintasoft.Imaging.Codecs.Decoders.RenderingSettings
      Vintasoft.Imaging.Codecs.Decoders.EcgRenderingSettings

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also