コード例 #1
0
ファイル: DdsFile.cs プロジェクト: falerin/Sims4Tools
        /// <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();
        }
コード例 #2
0
ファイル: DdsFile.cs プロジェクト: falerin/Sims4Tools
 /// <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);
 }
コード例 #3
0
ファイル: DdsFile.cs プロジェクト: dd-dk/s3pi
        /// <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();
        }