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


C# ImageResource类代码示例

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


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

示例1: 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

示例2: DeleteLayerHistoryMemento

 public DeleteLayerHistoryMemento(string name, ImageResource image, IHistoryWorkspace historyWorkspace, Layer deleteMe)
     : base(name, image)
 {
     this.historyWorkspace = historyWorkspace;
     this.index = historyWorkspace.Document.Layers.IndexOf(deleteMe);
     this.Data = new DeleteLayerHistoryMementoData(deleteMe);
 }
开发者ID:leejungho2,项目名称:xynotecgui,代码行数:7,代码来源:DeleteLayerHistoryMemento.cs

示例3: FlipDocumentFunction

 public FlipDocumentFunction(string historyName, ImageResource image, FlipType flipType)
     : base(ActionFlags.None)
 {
     this.historyName = historyName;
     this.undoImage = image;
     this.flipType = flipType;
 }
开发者ID:leejungho2,项目名称:xynotecgui,代码行数:7,代码来源:FlipDocumentFunction.cs

示例4: 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

示例5: FlipLayerHistoryMemento

 public FlipLayerHistoryMemento(string name, ImageResource image, IHistoryWorkspace historyWorkspace, int layerIndex, FlipType flipType)
     : base(name, image)
 {
     this.historyWorkspace = historyWorkspace;
     this.layerIndex = layerIndex;
     this.flipType = flipType;
 }
开发者ID:herbqiao,项目名称:paint.net,代码行数:7,代码来源:FlipLayerHistoryMemento.cs

示例6: ResolutionInfo

        /// <summary>
        /// Initializes a new instance of the <see cref="ResolutionInfo"/> class using the <see cref="ImageResource"/>.
        /// </summary>
        /// <param name="imgRes">The image resource to use.</param>
        public ResolutionInfo(ImageResource imgRes)
            : base(imgRes)
        {
            BinaryReverseReader dataReader = imgRes.DataReader;

            // read horizontal resolution
            dataReader.ReadInt16();

            // read horizontal resolution units (1=pixels per inch, 2=pixels per centimeter)
            dataReader.ReadInt32();

            // read the width units (1=inches, 2=cm, 3=pt, 4=picas, 5=columns)
            dataReader.ReadInt16();

            // read vertical resolution
            dataReader.ReadInt16();

            // read vertical resolution units (1=pixels per inch, 2=pixels per centimeter)
            dataReader.ReadInt32();

            // read the height units (1=inches, 2=cm, 3=pt, 4=picas, 5=columns)
            dataReader.ReadInt16();

            dataReader.Close();
        }
开发者ID:gekidoslair,项目名称:UnityPSDLayoutTool,代码行数:29,代码来源:ResolutionInfo.cs

示例7: 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

示例8: 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

示例9: LayerPropertyHistoryMemento

 public LayerPropertyHistoryMemento(string name, ImageResource image, IHistoryWorkspace historyWorkspace, int layerIndex)
     : base(name, image)
 {
     this.historyWorkspace = historyWorkspace;
     this.layerIndex = layerIndex;
     this.properties = ((Layer)this.historyWorkspace.Document.Layers[layerIndex]).SaveProperties();
 }
开发者ID:nkaligin,项目名称:paint-mono,代码行数:7,代码来源:LayerPropertyHistoryMemento.cs

示例10: BitmapHistoryMemento

        public BitmapHistoryMemento(string name, ImageResource image, IHistoryWorkspace historyWorkspace, 
            int layerIndex, PdnRegion changedRegion, Surface copyFromThisSurface)
            : base(name, image)
        {
            this.historyWorkspace = historyWorkspace;
            this.layerIndex = layerIndex;

            PdnRegion region = changedRegion.Clone();
            this.tempFileName = FileSystem.GetTempFileName();

            FileStream outputStream = null;

            try
            {
                outputStream = FileSystem.OpenStreamingFile(this.tempFileName, FileAccess.Write);
                SaveSurfaceRegion(outputStream, copyFromThisSurface, region);
            }

            finally
            {
                if (outputStream != null)
                {
                    outputStream.Dispose();
                    outputStream = null;
                }
            }

            this.tempFileHandle = new DeleteFileOnFree(this.tempFileName);
            BitmapHistoryMementoData data = new BitmapHistoryMementoData(null, region);

            this.Data = data;
        }
开发者ID:leejungho2,项目名称:xynotecgui,代码行数:32,代码来源:BitmapHistoryMemento.cs

示例11: FlipLayerFunction

 public FlipLayerFunction(string historyName, ImageResource image, FlipType flipType, int layerIndex)
     : base(ActionFlags.None)
 {
     this.historyName = historyName;
     this.flipType = flipType;
     this.undoImage = image;
     this.layerIndex = layerIndex;
 }
开发者ID:nkaligin,项目名称:paint-mono,代码行数:8,代码来源:FlipLayerFunction.cs

示例12: ReplaceDocumentHistoryMemento

        public ReplaceDocumentHistoryMemento(string name, ImageResource image, IHistoryWorkspace historyWorkspace)
            : base(name, image)
        {
            this.historyWorkspace = historyWorkspace;

            ReplaceDocumentHistoryMementoData data = new ReplaceDocumentHistoryMementoData(this.historyWorkspace.Document);
            this.Data = data;
        }
开发者ID:metadeta96,项目名称:openpdn,代码行数:8,代码来源:ReplaceDocumentHistoryMemento.cs

示例13: 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

示例14: MetaDataHistoryMemento

 public MetaDataHistoryMemento(string name, ImageResource image, IHistoryWorkspace historyWorkspace)
     : base(name, image)
 {
     this.historyWorkspace = historyWorkspace;
     Document document = new Document(1, 1); // we need some place to store the metadata...
     document.ReplaceMetaDataFrom(historyWorkspace.Document);
     MetaDataHistoryMementoData data = new MetaDataHistoryMementoData(document);
     this.Data = data;
 }
开发者ID:leejungho2,项目名称:xynotecgui,代码行数:9,代码来源:MetaDataHistoryMemento.cs

示例15: 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


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