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


C# Bitmap.ToARGBData方法代码示例

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


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

示例1: CreateImage

        /// <summary>
        /// Creates an image from a given <see cref="T:Bitmap"/>.
        /// If <paramref name="supportHSV"/> is true, also creates an HSVa-encoded version of the image.
        /// </summary>
        /// <param name="image"><see cref="T:Bitmap"/> from which to extract image pixels.</param>
        /// <param name="supportHSV">When true, create an HSVa-encoded version of the image.</param>
        public void CreateImage(Bitmap image, bool supportHSV)
        {
            this.width = image.Width;
            this.height = image.Height;
            this.useBlockCompression = true;
            this.useLuminence = false;
            this.alphaDepth = 5;

            this.baseImage = image.ToARGBData();

            this.currentImage = (uint[])this.baseImage.Clone();
            if (supportHSV) this.UpdateHSVData();
        }
开发者ID:falerin,项目名称:Sims4Tools,代码行数:19,代码来源:DdsFile.cs

示例2: MaskedApplyImage

 /// <summary>
 /// Use the <paramref name="mask"/> to apply the supplied bitmaps.
 /// </summary>
 /// <param name="mask">Determines to which areas each image is applied.</param>
 /// <param name="ch1Bitmap">Bitmap applied to <paramref name="mask"/> channel 1 area.</param>
 /// <param name="ch2Bitmap">Bitmap applied to <paramref name="mask"/> channel 2 area.</param>
 /// <param name="ch3Bitmap">Bitmap applied to <paramref name="mask"/> channel 3 area.</param>
 /// <param name="ch4Bitmap">Bitmap applied to <paramref name="mask"/> channel 4 area.</param>
 public void MaskedApplyImage(DdsFile mask, Bitmap ch1Bitmap, Bitmap ch2Bitmap, Bitmap ch3Bitmap, Bitmap ch4Bitmap)
 {
     this.MaskedApplyImage(mask,
         (ch1Bitmap == null) ? null : ch1Bitmap.ToARGBData(), (ch1Bitmap == null) ? Size.Empty : ch1Bitmap.Size,
         (ch2Bitmap == null) ? null : ch2Bitmap.ToARGBData(), (ch2Bitmap == null) ? Size.Empty : ch2Bitmap.Size,
         (ch3Bitmap == null) ? null : ch3Bitmap.ToARGBData(), (ch3Bitmap == null) ? Size.Empty : ch3Bitmap.Size,
         (ch4Bitmap == null) ? null : ch4Bitmap.ToARGBData(), (ch4Bitmap == null) ? Size.Empty : ch4Bitmap.Size);
 }
开发者ID:falerin,项目名称:Sims4Tools,代码行数:16,代码来源:DdsFile.cs

示例3: CreateImage

        /// <summary>
        /// Creates an image from a given <see cref="T:Bitmap"/>.
        /// If <paramref name="supportHSV"/> is true, also creates an HSVa-encoded version of the image.
        /// </summary>
        /// <param name="image"><see cref="T:Bitmap"/> from which to extract image pixels.</param>
        /// <param name="supportHSV">When true, create an HSVa-encoded version of the image.</param>
        public void CreateImage(Bitmap image, bool supportHSV)
        {
            width = image.Width;
            height = image.Height;
            useBlockCompression = true;
            useLuminence = false;
            alphaDepth = 5;

            baseImage = image.ToARGBData();

            currentImage = (uint[])baseImage.Clone();
            if (supportHSV) UpdateHSVData();
        }
开发者ID:dd-dk,项目名称:s3pi,代码行数:19,代码来源:DdsFile.cs


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