Exemple #1
0
        public static PsdDocument Create(Stream stream, PsdResolver resolver)
        {
            PsdDocument document = new PsdDocument();

            document.Read(stream, resolver, new Uri(Directory.GetCurrentDirectory()));
            return(document);
        }
Exemple #2
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);
        }
Exemple #3
0
        public PsdLayer(PsdReader reader, PsdDocument document)
        {
            this.document = document;
            this.records  = LayerRecordsReader.Read(reader);
            this.records  = LayerExtraRecordsReader.Read(reader, this.records);

            this.left   = this.records.Left;
            this.top    = this.records.Top;
            this.right  = this.records.Right;
            this.bottom = this.records.Bottom;
        }
Exemple #4
0
        public override PsdDocument GetDocument(Uri absoluteUri)
        {
            string filename = absoluteUri.LocalPath;

            if (File.Exists(filename) == false)
            {
                throw new FileNotFoundException(string.Format("{0} 파일을 찾을 수 없습니다.", filename), filename);
            }

            if (uriToDocuments.ContainsKey(absoluteUri) == false)
            {
                PsdDocument document = PsdDocument.Create(filename);
                uriToDocuments.Add(absoluteUri, document);
            }

            return(uriToDocuments[absoluteUri]);
        }
Exemple #5
0
 public static PsdDocument Create(Stream stream)
 {
     return(PsdDocument.Create(stream, null));
 }
Exemple #6
0
 public static PsdDocument Create(string filename)
 {
     return(PsdDocument.Create(filename, new PathResolver()));
 }