Esempio 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(FileHeaderSection.Read(reader));
         }
 }
Esempio 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 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);
        }
Esempio n. 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;
            }
        }
Esempio n. 4
0
        public static FileHeaderSection Read(PsdReader reader)
        {
            var instance = new FileHeaderSection(reader);

            return(instance);
        }