• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ImageResource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


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


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


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


示例19: ShapeTool

 public ShapeTool(DocumentWorkspace documentWorkspace,
                  ImageResource toolBarImage,
                  string name,
                  string helpText)
     : this(documentWorkspace,
            toolBarImage,
            name,
            helpText,
            defaultShortcut,
            ToolBarConfigItems.None,
            ToolBarConfigItems.None)
 {
 }
开发者ID:nkaligin,项目名称:paint-mono,代码行数:13,代码来源:ShapeTool.cs


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ImageSize类代码示例发布时间:2022-05-24
下一篇:
C# ImagePartType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap