Inheritance: IPsdLayer, IDisposable
コード例 #1
0
        public static PsdDocument Create(Stream stream, PsdResolver resolver)
        {
            PsdDocument document = new PsdDocument();

            document.Read(stream, resolver, new Uri(Directory.GetCurrentDirectory()));
            return(document);
        }
コード例 #2
0
ファイル: PsdDocument.cs プロジェクト: pc8181/psd-parser
 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;
 }
コード例 #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;
        }
コード例 #4
0
ファイル: PsdLayer.cs プロジェクト: NtreevSoft/psd-parser
        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;
        }
コード例 #5
0
        public PSDItemViewModel(PsdDocument document)
            : base(null)
        {
            this.document = document;

            this.Children.Add(new PropertiesItemViewModel("Resources", document.Resources, this));
            this.Children.Add(new PropertiesItemViewModel("ImageResources", document.ImageResources, this));

            foreach (var item in document.Childs)
            {
                this.Children.Add(new LayerItemViewModel(item, this));
            }
        }
コード例 #6
0
ファイル: PathResolver.cs プロジェクト: Glutoblop/psd-parser
        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]);
        }
コード例 #7
0
        protected override void ReadData(PsdReader reader, object userData)
        {
            PsdDocument document = userData as PsdDocument;

            var layerInfo = new LayerInfoBlock(reader, document);

            if (reader.Position + 4 >= this.EndPosition)
            {
                LayerInfo           = layerInfo;
                GlobalLayerMaskInfo = null;
                DocumentResource    = new DocumentResourceBlock();
            }
            else
            {
                GlobalLayerMaskInfoBlock globalLayerMask = new GlobalLayerMaskInfoBlock(reader);
                var documentResource = new DocumentResourceBlock(reader, this.EndPosition - reader.Position);

                LayerInfo           = layerInfo;
                GlobalLayerMaskInfo = globalLayerMask;
                DocumentResource    = documentResource;
            }
        }
コード例 #8
0
 public static PsdDocument Create(Stream stream)
 {
     return(PsdDocument.Create(stream, null));
 }
コード例 #9
0
 public static PsdDocument Create(string filename)
 {
     return(PsdDocument.Create(filename, new PathResolver()));
 }
コード例 #10
0
 public LayerAndMaskInformationSection(PsdReader reader, PsdDocument document)
 {
     Init(reader, true, document);
 }
コード例 #11
0
ファイル: PsdDocument.cs プロジェクト: NtreevSoft/psd-parser
 public static PsdDocument Create(Stream stream, PsdResolver resolver)
 {
     PsdDocument document = new PsdDocument();
     document.Read(stream, resolver, new Uri(Directory.GetCurrentDirectory()));
     return document;
 }
コード例 #12
0
ファイル: PsdDocument.cs プロジェクト: NtreevSoft/psd-parser
 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;
 }