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(FileHeaderSection.Read(reader));
         }
 }
Beispiel #2
0
        internal void Read(Stream stream, PsdResolver resolver, Uri uri)
        {
            this.reader = new PsdReader(stream, resolver, uri);
            this.reader.ReadDocumentHeader();

            this.fileHeaderSection     = new FileHeaderSection(this.reader);
            this.colorModeDataSection  = new ColorModeDataSection(this.reader);
            this.imageResourcesSection = new ImgageResourcesSection(this.reader);
            this.layerAndMaskSection   = new LayerAndMaskInformationSection(this.reader, this);
            this.imageDataSection      = new ImageDataSection(this.reader, this);
        }
Beispiel #3
0
        public EmbeddedLayer(Guid id, PsdResolver resolver, Uri absoluteUri)
        {
            this.id          = id;
            this.resolver    = resolver;
            this.absoluteUri = absoluteUri;

            if (File.Exists(this.absoluteUri.LocalPath) == true)
            {
                var header = FileHeaderSection.FromFile(this.absoluteUri.LocalPath);
                this.width  = header.Width;
                this.height = header.Height;
            }
        }
        public static FileHeaderSection Read(PsdReader reader)
        {
            var instance = new FileHeaderSection(reader);

            return(instance);
        }