Ejemplo n.º 1
0
 public static FileHeaderSection FromFile(string filename)
 {
     using (FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
         using (PsdReader reader = new PsdReader(stream, new PathResolver(), new Uri(Path.GetDirectoryName(filename))))
         {
             reader.ReadDocumentHeader();
             return(FileHeaderSectionReader.Read(reader));
         }
 }
Ejemplo n.º 2
0
        internal void Read(Stream stream, PsdResolver resolver, Uri uri)
        {
            this.reader = new PsdReader(stream, resolver, uri);
            this.reader.ReadDocumentHeader();

            this.fileHeaderSection     = new FileHeaderSectionReader(this.reader);
            this.colorModeDataSection  = new ColorModeDataSectionReader(this.reader);
            this.imageResourcesSection = new ImageResourcesSectionReader(this.reader);
            this.layerAndMaskSection   = new LayerAndMaskInformationSectionReader(this.reader, this);
            this.imageDataSection      = new ImageDataSectionReader(this.reader, this);
        }
Ejemplo n.º 3
0
 public override void ReadValue(PsdReader reader, object userData, out FileHeaderSection value)
 {
     if (this.IsDocument(reader) == true)
     {
         using (Stream stream = new RangeStream(reader.Stream, reader.Position, this.Length))
             using (PsdReader r = new PsdReader(stream, reader.Resolver, reader.Uri))
             {
                 r.ReadDocumentHeader();
                 value = FileHeaderSectionReader.Read(r);
             }
     }
     else
     {
         value = new FileHeaderSection();
     }
 }
Ejemplo n.º 4
0
        internal void Read(Stream stream, PsdResolver resolver, Uri uri)
        {
            this.reader = new PsdReader(stream, resolver, uri);
            this.reader.ReadDocumentHeader();

            this.fileHeaderSection = new FileHeaderSectionReader(this.reader);
            this.colorModeDataSection = new ColorModeDataSectionReader(this.reader);
            this.imageResourcesSection = new ImageResourcesSectionReader(this.reader);
            this.layerAndMaskSection = new LayerAndMaskInformationSectionReader(this.reader, this);
            this.imageDataSection = new ImageDataSectionReader(this.reader, this);
        }