当前位置: 首页>>代码示例>>C#>>正文


C# MagickImageCollection.AppendVertically方法代码示例

本文整理汇总了C#中ImageMagick.MagickImageCollection.AppendVertically方法的典型用法代码示例。如果您正苦于以下问题:C# MagickImageCollection.AppendVertically方法的具体用法?C# MagickImageCollection.AppendVertically怎么用?C# MagickImageCollection.AppendVertically使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageMagick.MagickImageCollection的用法示例。


在下文中一共展示了MagickImageCollection.AppendVertically方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CombineScreenshot

        /// <summary>
        /// Combines the screenshots into one contiguous screenshot
        /// </summary>
        /// <param name="files">The files (images) to combine</param>
        /// <param name="e">For UX, an output progress message</param>
        public static void CombineScreenshot(FileSystemInfo[] files, WaitWindowEventArgs e)
        {
           

            string screenshotLocation = Path.Combine(Constants.CacheLocation, "temp.png");

            using (MagickImageCollection images = new MagickImageCollection())
            {
                // Add the first image
                var orderedFiles = files.OrderBy(f => f.CreationTime);
                foreach (FileSystemInfo file in orderedFiles)
                {
                    MagickImage first = new MagickImage(file.FullName);
                    e.Window.Message = "Obtaining Snapshots... Please Wait";
                    images.Add(first);
                }

                using (MagickImage result = images.AppendVertically())
                {
                    e.Window.Message = "Building Screenshot... Please Wait" + System.Environment.NewLine + "This can take a minute.";
                    try
                    {
                        result.Write(screenshotLocation);
                    } catch (MagickImageErrorException err)
                    {
                        Debug.WriteLine($"Error: {err}");
                    }
                   
                }
        
            }
        }
开发者ID:joe-williams-cccu,项目名称:OSIRTv2,代码行数:37,代码来源:ScreenshotHelper.cs

示例2: ConvertPDFTOneImage

    public static void ConvertPDFTOneImage()
    {
      MagickReadSettings settings = new MagickReadSettings();
      // Settings the density to 300 dpi will create an image with a better quality
      settings.Density = new PointD(300, 300);

      using (MagickImageCollection images = new MagickImageCollection())
      {
        // Add all the pages of the pdf file to the collection
        images.Read(SampleFiles.SnakewarePdf, settings);

        // Create new image that appends all the pages horizontally
        using (MagickImage horizontal = images.AppendHorizontally())
        {
          // Save result as a png
          horizontal.Write(SampleFiles.OutputDirectory + "Snakeware.horizontal.png");
        }

        // Create new image that appends all the pages horizontally
        using (MagickImage vertical = images.AppendVertically())
        {
          // Save result as a png
          vertical.Write(SampleFiles.OutputDirectory + "Snakeware.vertical.png");
        }
      }
    }
开发者ID:levesque,项目名称:Magick.NET,代码行数:26,代码来源:ConvertPDF.cs

示例3: Test_Append

    public void Test_Append()
    {
      int width = 70;
      int height = 46;

      using (MagickImageCollection collection = new MagickImageCollection(Files.RoseSparkleGIF))
      {
        Assert.AreEqual(width, collection[0].Width);
        Assert.AreEqual(height, collection[0].Height);

        using (MagickImage image = collection.AppendHorizontally())
        {
          Assert.AreEqual(width * 3, image.Width);
          Assert.AreEqual(height, image.Height);
        }

        using (MagickImage image = collection.AppendVertically())
        {
          Assert.AreEqual(width, image.Width);
          Assert.AreEqual(height * 3, image.Height);
        }
      }
    }
开发者ID:levesque,项目名称:Magick.NET,代码行数:23,代码来源:MagickImageCollectionTests.cs

示例4: Test_Append

    public void Test_Append()
    {
      int width = 70;
      int height = 46;

      using (MagickImageCollection collection = new MagickImageCollection())
      {
        ExceptionAssert.Throws<InvalidOperationException>(delegate ()
        {
          collection.AppendHorizontally();
        });

        ExceptionAssert.Throws<InvalidOperationException>(delegate ()
        {
          collection.AppendVertically();
        });

        collection.Read(Files.RoseSparkleGIF);

        Assert.AreEqual(width, collection[0].Width);
        Assert.AreEqual(height, collection[0].Height);

        using (MagickImage image = collection.AppendHorizontally())
        {
          Assert.AreEqual(width * 3, image.Width);
          Assert.AreEqual(height, image.Height);
        }

        using (MagickImage image = collection.AppendVertically())
        {
          Assert.AreEqual(width, image.Width);
          Assert.AreEqual(height * 3, image.Height);
        }
      }
    }
开发者ID:dlemstra,项目名称:Magick.NET,代码行数:35,代码来源:MagickImageCollectionTests.cs

示例5: ExecuteAppendVertically

 private static MagickImage ExecuteAppendVertically(MagickImageCollection collection)
 {
   return collection.AppendVertically();
 }
开发者ID:levesque,项目名称:Magick.NET,代码行数:4,代码来源:MagickImageCollection.cs

示例6: Test_FlipFlop

    public void Test_FlipFlop()
    {
      using (MagickImageCollection collection = new MagickImageCollection())
      {
        collection.Add(new MagickImage(MagickColors.DodgerBlue, 10, 10));
        collection.Add(new MagickImage(MagickColors.Firebrick, 10, 10));

        using (MagickImage image = collection.AppendVertically())
        {
          ColorAssert.AreEqual(MagickColors.DodgerBlue, image, 5, 0);
          ColorAssert.AreEqual(MagickColors.Firebrick, image, 5, 10);

          image.Flip();

          ColorAssert.AreEqual(MagickColors.Firebrick, image, 5, 0);
          ColorAssert.AreEqual(MagickColors.DodgerBlue, image, 5, 10);
        }

        using (MagickImage image = collection.AppendHorizontally())
        {
          ColorAssert.AreEqual(MagickColors.DodgerBlue, image, 0, 5);
          ColorAssert.AreEqual(MagickColors.Firebrick, image, 10, 5);

          image.Flop();

          ColorAssert.AreEqual(MagickColors.Firebrick, image, 0, 5);
          ColorAssert.AreEqual(MagickColors.DodgerBlue, image, 10, 5);
        }
      }
    }
开发者ID:dlemstra,项目名称:Magick.NET,代码行数:30,代码来源:MagickImageTests.cs


注:本文中的ImageMagick.MagickImageCollection.AppendVertically方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。