public static PsdDocument Create(Stream stream, PsdResolver resolver) { PsdDocument document = new PsdDocument(); document.Read(stream, resolver, new Uri(Directory.GetCurrentDirectory())); return(document); }
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; }
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; }
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)); } }
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]); }
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; } }
public static PsdDocument Create(Stream stream) { return(PsdDocument.Create(stream, null)); }
public static PsdDocument Create(string filename) { return(PsdDocument.Create(filename, new PathResolver())); }
public LayerAndMaskInformationSection(PsdReader reader, PsdDocument document) { Init(reader, true, document); }
public static PsdDocument Create(Stream stream, PsdResolver resolver) { PsdDocument document = new PsdDocument(); document.Read(stream, resolver, new Uri(Directory.GetCurrentDirectory())); return document; }