当前位置: 首页>>代码示例>>C#>>正文


C# ImageResource.GetDataReader方法代码示例

本文整理汇总了C#中ImageResource.GetDataReader方法的典型用法代码示例。如果您正苦于以下问题:C# ImageResource.GetDataReader方法的具体用法?C# ImageResource.GetDataReader怎么用?C# ImageResource.GetDataReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageResource的用法示例。


在下文中一共展示了ImageResource.GetDataReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Slices

        public Slices(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();
            this.Version = reader.ReadUInt32();
            this.Rectangle = reader.ReadPSDRectangle(); // new Rectangle(reader).ToERectangle();
            this.SlicesName = reader.ReadPSDUnicodeString();

            int cnt = (int)reader.ReadUInt32();
            this.SliceList = new List<Slice>();
            for (int i = 0; i < cnt; i++)
                this.SliceList.Add(new Slice(reader));

            int unknown1 = (int)reader.ReadUInt32();
            int unknown2 = (int)reader.ReadUInt32();
            ushort unknown3 = reader.ReadUInt16();
            string unknown4 = DynVal.ReadSpecialString(reader);
            int unknown5 = (int)reader.ReadUInt32();

            this.Values = new List<DynVal>();
            while (reader.BytesToEnd > 0)
            {
                DynVal val = DynVal.ReadValue(reader, false);
                this.Values.Add(val);
            }
            //this.Values = DynVal.ReadValues(reader);
            //this.Data = reader.ReadBytes((int)reader.BytesToEnd);
            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:29,代码来源:Slices.cs

示例2: CopyrightInfo

 public CopyrightInfo(ImageResource imgRes)
     : base(imgRes)
 {
     BinaryPSDReader reader = imgRes.GetDataReader();
     this.Value = reader.ReadByte() == 0 ? false : true;
     reader.Close();
 }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:7,代码来源:DivResources.cs

示例3: ResolutionInfo

        public ResolutionInfo(ImageResource imgRes)
            : base(imgRes)
        {
            //m_bResolutionInfoFilled = true;
            BinaryReverseReader reader = imgRes.GetDataReader();

            this.hRes = reader.ReadInt16();
            this.hResUnit = reader.ReadInt32();
            this.widthUnit = reader.ReadInt16();

            this.vRes = reader.ReadInt16();
            this.vResUnit = reader.ReadInt32();
            this.heightUnit = reader.ReadInt16();

            reader.Close();

            //int ppm_x = 3780;	// 96 dpi
            //int ppm_y = 3780;	// 96 dpi

            //if (psd.ResolutionInfo != null)
            //{
            //    int nHorzResolution = (int)psd.ResolutionInfo.hRes;
            //    int nVertResolution = (int)psd.ResolutionInfo.vRes;

            //    ppm_x = (nHorzResolution * 10000) / 254;
            //    ppm_y = (nVertResolution * 10000) / 254;
            //}
        }
开发者ID:timdetering,项目名称:Endogine,代码行数:28,代码来源:ResolutionInfo.cs

示例4: Thumbnail

        public Thumbnail(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();

            //m_bThumbnailFilled = true;

            this.Format = reader.ReadInt32();
            this.Width = reader.ReadInt32();
            this.Height = reader.ReadInt32();
            this.WidthBytes = reader.ReadInt32(); //padded row bytes (
            this.Size = reader.ReadInt32(); //Total size widthbytes * height * planes
            this.CompressedSize = reader.ReadInt32(); //used for consistancy check
            this.BitPerPixel = reader.ReadInt16();
            this.Planes = reader.ReadInt16();

            int numBytes = (int)reader.BytesToEnd;
            byte[] buffer = reader.ReadBytes(numBytes);

            if (this.ID == 1033)
            {
                // BGR
                for (int n = 0; n < numBytes - 2; n += 3)
                {
                    byte tmp = buffer[n + 2];
                    buffer[n + 2] = buffer[n];
                    buffer[n] = tmp;
                }
            }
            System.IO.MemoryStream stream = new System.IO.MemoryStream(buffer);
            this.Bitmap = new System.Drawing.Bitmap(stream);

            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:34,代码来源:Thumbnail.cs

示例5: ColorTransferFunctions

 public ColorTransferFunctions(ImageResource imgRes)
     : base(imgRes)
 {
     BinaryPSDReader reader = imgRes.GetDataReader();
     this.Functions = new List<ColorTransferFunction>();
     for (int i = 0; i < 4; i++)
         this.Functions.Add(new ColorTransferFunction(reader));
     reader.Close();
 }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:9,代码来源:ColorTransferFunctions.cs

示例6: LayersGroupInfo

        public LayersGroupInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();

            this.GroupIds = new List<ushort>();
            while (reader.BytesToEnd > 0)
                this.GroupIds.Add(reader.ReadUInt16());

            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:11,代码来源:LayersGroupInfo.cs

示例7: XMLInfo

        public XMLInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();
            string xml = new string(reader.ReadPSDChars((int)reader.BaseStream.Length));
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);
            this.Xml = doc;

            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:11,代码来源:XMLInfo.cs

示例8: VersionInfo

        public VersionInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();
            this.Version = reader.ReadUInt32();
            this.HasRealMergedData = reader.ReadBoolean();
            this.WriterName = reader.ReadPSDUnicodeString();
            this.ReaderName = reader.ReadPSDUnicodeString();
            this.FileVersion = reader.ReadUInt32();

            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:12,代码来源:VersionInfo.cs

示例9: ColorHalftoneInfo

        public ColorHalftoneInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();

            this.Screens = new List<Screen>();
            for (int i = 0; i < 4; i++)
            {
                this.Screens.Add(new Screen(reader));
            }

            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:13,代码来源:Halftone.cs

示例10: DisplayInfo

        public short Opacity; // 0..100

        #endregion Fields

        #region Constructors

        public DisplayInfo(ImageResource imgRes)
        {
            BinaryReverseReader reader = imgRes.GetDataReader();

            this.ColorSpace = (ColorModes)reader.ReadInt16();
            for(int i=0; i<4; i++)
                this.Color[i] = reader.ReadInt16();

            this.Opacity = (short)Math.Max(0,Math.Min(100,(int)reader.ReadInt16()));
            this.kind = reader.ReadByte()==0?false:true;

            reader.Close();
        }
开发者ID:timdetering,项目名称:Endogine,代码行数:19,代码来源:DisplayInfo.cs

示例11: AlphaChannelNames

 public AlphaChannelNames(ImageResource imgRes)
     : base(imgRes)
 {
     BinaryPSDReader reader = imgRes.GetDataReader();
     while (reader.BytesToEnd > 0)
     {
         //no padding in these strings!
         byte length = reader.ReadByte();
         string name = new string(reader.ReadPSDChars(length));
         if (name.Length > 0)
             this._names.Add(name);
     }
     reader.Close();
 }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:14,代码来源:AlphaChannelNames.cs

示例12: ResolutionInfo

        public ResolutionInfo(ImageResource imgRes)
            : base(imgRes)
        {
            //m_bResolutionInfoFilled = true;
            BinaryPSDReader reader = imgRes.GetDataReader();

            this.hRes = reader.ReadInt16();
            this.hResUnit = reader.ReadInt32();
            this.widthUnit = reader.ReadInt16();

            this.vRes = reader.ReadInt16();
            this.vResUnit = reader.ReadInt32();
            this.heightUnit = reader.ReadInt16();

            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:16,代码来源:ResolutionInfo.cs

示例13: GridGuidesInfo

        public GridGuidesInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryPSDReader reader = imgRes.GetDataReader();

            uint Version = reader.ReadUInt32();

            //Future implementation of document-specific grids. Initially, set the grid cycle to every quarter inch. At 72 dpi, that would be 18 * 32 = 576 (0x240)
            this.GridCycle = reader.ReadUInt64();

            uint guideCount = reader.ReadUInt32();

            for (int i = 0; i < guideCount; i++)
            {
                GridGuide guide = new GridGuide(reader);
                this.Guides.Add(guide);
            }

            reader.Close();
        }
开发者ID:stukalin,项目名称:ImageResizer,代码行数:20,代码来源:GridGuidesInfo.cs

示例14: Thumbnail

        public Thumbnail(ImageResource imgRes)
        {
            BinaryReverseReader reader = imgRes.GetDataReader();

            //m_bThumbnailFilled = true;

            this.nFormat = reader.ReadInt32();
            this.nWidth = reader.ReadInt32();
            this.nHeight = reader.ReadInt32();
            this.nWidthBytes = reader.ReadInt32();
            this.nSize = reader.ReadInt32();
            this.nCompressedSize = reader.ReadInt32();
            this.nBitPerPixel = reader.ReadInt16();
            this.nPlanes = reader.ReadInt16();

            int nTotalData = this.nSize - 28; // header

            byte [] buffer = new byte[nTotalData];
            if (this.ID == 1033)
            {
                // BGR
                for(int n=0; n<nTotalData; n=n+3)
                {
                    buffer[n+2] = reader.ReadByte();
                    buffer[n+1] = reader.ReadByte();
                    buffer[n+0] = reader.ReadByte();
                }
            }
            else if (this.ID == 1036)
            {
                // RGB
                for (int n=0; n<nTotalData; ++n)
                    buffer[n] = reader.ReadByte();
            }
            reader.Close();
        }
开发者ID:timdetering,项目名称:Endogine,代码行数:36,代码来源:Thumbnail.cs

示例15: CopyrightInfo

 public CopyrightInfo(ImageResource imgRes)
 {
     BinaryReverseReader reader = imgRes.GetDataReader();
     this.Copyrighted = reader.ReadByte()==0?false:true;
     reader.Close();
 }
开发者ID:timdetering,项目名称:Endogine,代码行数:6,代码来源:CopyrightInfo.cs


注:本文中的ImageResource.GetDataReader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。