Class for defines that are used when a psd image is written.
Inheritance: DefineCreator, IWriteDefines
Exemplo n.º 1
0
        private IDefines CreatePsdWriteDefines(XmlElement element)
        {
            if (element == null)
            {
                return(null);
            }
            PsdWriteDefines result = new PsdWriteDefines();

            result.AdditionalInfo = Variables.GetValue <PsdAdditionalInfo>(element, "additionalInfo");
            return(result);
        }
Exemplo n.º 2
0
    private static void WriteAndCheckProfile(MagickImageCollection images, PsdWriteDefines defines, int expectedLength)
    {
      using (MemoryStream memStream = new MemoryStream())
      {
        images.Write(memStream, defines);

        memStream.Position = 0;
        images.Read(memStream);
        CheckProfile(images[1], expectedLength);
      }
    }
Exemplo n.º 3
0
    public void Test_AdditionalInfo()
    {

      using (MagickImageCollection 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);
      }
    }
Exemplo n.º 4
0
 private IDefines CreatePsdWriteDefines(XmlElement element)
 {
   if (element == null)
     return null;
   PsdWriteDefines result = new PsdWriteDefines();
   result.AdditionalInfo = Variables.GetValue<PsdAdditionalInfo>(element, "additionalInfo");
   return result;
 }