コード例 #1
0
        private static void WriteAndCheckProfile(IMagickImageCollection images, PsdWriteDefines defines, int expectedLength)
        {
            using (MemoryStream memStream = new MemoryStream())
            {
                images.Write(memStream, defines);

                memStream.Position = 0;
                images.Read(memStream);
                CheckProfile(images[1], expectedLength);
            }
        }
コード例 #2
0
        public void Test_AdditionalInfo()
        {
            using (IMagickImageCollection images = new MagickImageCollection())
            {
                images.Read(Files.Coders.LayerStylesSamplePSD);

                CheckProfile(images[1], 264);

                var defines = new PsdWriteDefines()
                {
                    AdditionalInfo = PsdAdditionalInfo.All
                };
                WriteAndCheckProfile(images, defines, 264);

                defines.AdditionalInfo = PsdAdditionalInfo.Selective;
                WriteAndCheckProfile(images, defines, 152);

                defines.AdditionalInfo = PsdAdditionalInfo.None;
                WriteAndCheckProfile(images, defines, 0);
            }
        }
コード例 #3
0
            public void ShouldMakeSetWhichAdditionalInfoShouldBeWritten()
            {
                using (var images = new MagickImageCollection())
                {
                    images.Read(Files.Coders.LayerStylesSamplePSD);

                    CheckProfile(images[1], 264);

                    var defines = new PsdWriteDefines
                    {
                        AdditionalInfo = PsdAdditionalInfoPart.All,
                    };
                    WriteAndCheckProfile(images, defines, 264);

                    defines.AdditionalInfo = PsdAdditionalInfoPart.Selective;
                    WriteAndCheckProfile(images, defines, 152);

                    defines.AdditionalInfo = PsdAdditionalInfoPart.None;
                    WriteAndCheckProfile(images, defines, 0);
                }
            }