예제 #1
0
        public void CombiningTwoSplittedStripsTogether2()
        {
            Size          A4            = Bindings.TemplatesTools.getA4(96, false);
            DuplexBuilder duplexBuilder = new DuplexBuilder(
                new Tools.LoggerHelper("test"),
                A4,
                3,
                padPercent: 0f
                );

            WebtoonPage page = new WebtoonPage()
            {
                filpath = "p1.png",
                width   = 690,
                height  = 212,
            };
            WebtoonPage page2 = new WebtoonPage()
            {
                filpath = "p2.png",
                width   = 690,
                height  = 1885,
            };

            DrawMock mock = new DrawMock();


            List <PageFragmnet> fragmantsToRead = new List <PageFragmnet>();

            fragmantsToRead.AddRange(duplexBuilder.splitPageLandscape(page));
            fragmantsToRead.AddRange(duplexBuilder.splitPageLandscape(page2));

            printFrags(fragmantsToRead);

            var outputPages = duplexBuilder.saveCahpterFragmentsInto_PNG_LTR(
                fragmantsToRead,
                "",
                "",
                mock: mock
                );

            var usedColumns     = outputPages.Sum((p) => p.ColCount());
            var usedPrintOrders = outputPages.Sum((p) => (p.GetCols.Sum((c) => c.getPrintSources.Count)));

            Assert.AreEqual(4, usedPrintOrders);

            CheckDrawInsideBounds(mock, usedColumns, 2);
        }
예제 #2
0
        public void CombiningTwoSplittedStripsTogether()
        {
            Size          A4            = Bindings.TemplatesTools.getA4(96, false);
            DuplexBuilder duplexBuilder = new DuplexBuilder(
                new Tools.LoggerHelper("test"),
                A4,
                3,
                padPercent: 0f
                );

            int colW = A4.Width / 3;
            int colH = A4.Height;

            WebtoonPage page = new WebtoonPage()
            {
                filpath = "p1.png",
                width   = colW,
                height  = (int)(colH * 1.2f),
            };
            WebtoonPage page2 = new WebtoonPage()
            {
                filpath = "p2.png",
                width   = colW,
                height  = (int)(colH * 1.2f),
            };

            DrawMock            mock            = new DrawMock();
            List <PageFragmnet> fragmantsToRead = new List <PageFragmnet>();

            fragmantsToRead.AddRange(duplexBuilder.splitPageLandscape(page));
            fragmantsToRead.AddRange(duplexBuilder.splitPageLandscape(page2));

            printFrags(fragmantsToRead);

            var outputPages = duplexBuilder.saveCahpterFragmentsInto_PNG_LTR(
                fragmantsToRead,
                "",
                "",
                mock: mock
                );

            var usedColumns = outputPages.Sum((p) => p.ColCount());

            CheckDrawInsideBounds(mock, usedColumns, 3);
        }
예제 #3
0
        private static List <PageFragmnet> SplitFile(
            DuplexOptions opt, string input_file, string file, string output_file, LoggerHelper log, DuplexBuilder d)
        {
            log.i(string.Format("Splitting strip: '" + file + "'"));
            var toon = new WebtoonPage()
            {
                filpath = input_file
            };

            using (MagickImage img = new MagickImage(file))
            {
                toon.height = img.Height;
                toon.width  = img.Width;
            }
            return(d.splitPageLandscape(toon));
        }