VintaSoft Imaging .NET SDK 14.0: Документация для .NET разработчика
Vintasoft.Imaging.Codecs.ImageFiles.Raw Namespace / NefPage Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
В этом разделе
    Класс NefPage
    В этом разделе
    Представляет страницу NEF-файла (Nikon).
    Объектная модель
    Resolution Palette ImageFileSource NefPage
    Синтаксис
    'Declaration
    
    Public NotInheritable Class NefPage
       Inherits RawImagePageBase
    
    
    public sealed class NefPage : RawImagePageBase
    
    
    public __gc __sealed class NefPage : public RawImagePageBase*
    
    
    public ref class NefPage sealed : public RawImagePageBase^
    
    
    Пример

    Вот пример, показывающий, как открыть NEF-файл, получить RAW-изображение из NEF-файла и сохранить изображение в PNG-файл:

    
    ''' <summary>
    ''' Opens Nikon NEF-file, gets RAW-image from NEF-file and saves image to a PNG-file.
    ''' </summary>
    ''' <param name="crwFilename">The name of NEF-file.</param>
    Public Sub GetAndSaveNefRawImage(crwFilename As String)
        ' open NEF-file stream
        Using fs As New System.IO.FileStream(crwFilename, System.IO.FileMode.Open, System.IO.FileAccess.Read)
            ' open NEF-file
            Dim rawImageFile As New Vintasoft.Imaging.Codecs.ImageFiles.Raw.RawImageFile(fs)
            ' get NEF-page
            Dim nefPage As Vintasoft.Imaging.Codecs.ImageFiles.Raw.NefPage = TryCast(rawImageFile.Page, Vintasoft.Imaging.Codecs.ImageFiles.Raw.NefPage)
            ' if NEF-page is found in RAW-file
            If nefPage IsNot Nothing Then
                ' get RAW-image as 48-bpp RGB image
                Using rawImage As Vintasoft.Imaging.VintasoftImage = nefPage.GetImage()
                    ' save 48-bpp RGB image to a PNG file
                    rawImage.Save(crwFilename & ".png")
                End Using
            End If
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Opens Nikon NEF-file, gets RAW-image from NEF-file and saves image to a PNG-file.
    /// </summary>
    /// <param name="crwFilename">The name of NEF-file.</param>
    public void GetAndSaveNefRawImage(string crwFilename)
    {
        // open NEF-file stream
        using (System.IO.FileStream fs = new System.IO.FileStream(crwFilename, System.IO.FileMode.Open, System.IO.FileAccess.Read))
        {
            // open NEF-file
            Vintasoft.Imaging.Codecs.ImageFiles.Raw.RawImageFile rawImageFile =
                new Vintasoft.Imaging.Codecs.ImageFiles.Raw.RawImageFile(fs);
            // get NEF-page
            Vintasoft.Imaging.Codecs.ImageFiles.Raw.NefPage nefPage =
                rawImageFile.Page as Vintasoft.Imaging.Codecs.ImageFiles.Raw.NefPage;
            // if NEF-page is found in RAW-file
            if (nefPage != null)
            {
                // get RAW-image as 48-bpp RGB image
                using (Vintasoft.Imaging.VintasoftImage rawImage = nefPage.GetImage())
                {
                    // save 48-bpp RGB image to a PNG file
                    rawImage.Save(crwFilename + ".png");
                }
            }
        }
    }
    
    

    Иерархия наследования

    System.Object
       Vintasoft.Imaging.Codecs.ImageFiles.ImageFileBlock
          Vintasoft.Imaging.Codecs.ImageFiles.ImagePage
             Vintasoft.Imaging.Codecs.ImageFiles.Raw.RawImagePageBase
                Vintasoft.Imaging.Codecs.ImageFiles.Raw.NefPage

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также