コード例 #1
0
        public void Save(string fileName)
        {
            Bind();

            var decomp = GetDecompressedRawImageData(0);
            var bitmap = BitmapImageHelper.CreateBitmap(decomp, Width, Height * 6);

            bitmap.Save(fileName);

            Unbind();
        }
コード例 #2
0
        public void Save(string fileName)
        {
            Bind();
            for (int i = 0; i < 6; i++)
            {
                byte[] output = new byte[Width * Height * 4];
                GL.GetTextureSubImage((int)this.Target, 0, 0, 0, i, Width, Height, 1,
                                      PixelFormat.Bgra, PixelType.UnsignedByte, output.Length, output);

                //Remove alpha
                output = SetImageData(output, true, true);

                var bitmap = BitmapImageHelper.CreateBitmap(output, Width, Height);
                bitmap.Save(fileName + $"_{i}.png");
            }
            Unbind();
        }