Example #1
0
 public PsdReader(Stream stream, PsdResolver resolver, Uri uri)
 {
     this.stream   = stream;
     this.reader   = new InternalBinaryReader(stream);
     this.resolver = resolver;
     this.uri      = uri;
 }
Example #2
0
        public static PsdDocument Create(Stream stream, PsdResolver resolver)
        {
            PsdDocument document = new PsdDocument();

            document.Read(stream, resolver, new Uri(Directory.GetCurrentDirectory()));
            return(document);
        }
Example #3
0
 public static PsdDocument Create(string filename, PsdResolver resolver)
 {
     PsdDocument document = new PsdDocument();
     FileInfo fileInfo = new FileInfo(filename);
     FileStream stream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read, FileShare.Read);
     document.Read(stream, resolver, new Uri(fileInfo.DirectoryName));
     return document;
 }
Example #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);
        }
Example #5
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;
            }
        }
Example #6
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);
        }
Example #7
0
 public static PsdDocument Create(Stream stream, PsdResolver resolver)
 {
     PsdDocument document = new PsdDocument();
     document.Read(stream, resolver, new Uri(Directory.GetCurrentDirectory()));
     return document;
 }
Example #8
0
 public static PsdDocument Create(string filename, PsdResolver resolver)
 {
     PsdDocument document = new PsdDocument();
     FileInfo fileInfo = new FileInfo(filename);
     FileStream stream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read, FileShare.Read);
     document.Read(stream, resolver, new Uri(fileInfo.DirectoryName));
     return document;
 }