當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。