Esempio n. 1
0
        static public void foreground1(string printPath)
        {
            try
            {
                var firstImage = System.Drawing.Image.FromFile(ReSize.naming(1));
                firstImage.RotateFlip(RotateFlipType.Rotate270FlipNone);
                string tempPath = System.IO.Path.Combine(ActualTemplateDirectory(), "foreground_1.png");

                var foreground = System.Drawing.Image.FromFile(tempPath);

                tempPath = System.IO.Path.Combine(ActualTemplateDirectory(), "empty.png");
                var empty = System.Drawing.Image.FromFile(tempPath);


                using (Graphics grfx = Graphics.FromImage(empty))
                {
                    grfx.DrawImage(firstImage, 0, 0);

                    grfx.DrawImage(foreground, 0, 0);

                    empty.Save(printPath);
                    empty.Dispose();
                }
            }
            catch (FileNotFoundException)
            {
            }
        }
Esempio n. 2
0
        static public void foreground4stripes(string printPath)
        {
            try
            {
                var firstImage = System.Drawing.Image.FromFile(ReSize.naming(1));

                var secondImage = System.Drawing.Image.FromFile(ReSize.naming(2));

                var thirdImage = System.Drawing.Image.FromFile(ReSize.naming(3));

                var fourthImage = System.Drawing.Image.FromFile(ReSize.naming(4));

                string tempPath = System.IO.Path.Combine(ActualTemplateDirectory(), "foreground_4_paski.png");

                var foreground = System.Drawing.Image.FromFile(tempPath);

                tempPath = System.IO.Path.Combine(ActualTemplateDirectory(), "empty.png");
                var empty = System.Drawing.Image.FromFile(tempPath);


                using (Graphics grfx = Graphics.FromImage(empty))
                {
                    grfx.DrawImage(firstImage, 50, 80);
                    grfx.DrawImage(secondImage, 50, 472);
                    grfx.DrawImage(thirdImage, 50, 866);
                    grfx.DrawImage(fourthImage, 50, 1260);
                    grfx.DrawImage(firstImage, 645, 80);
                    grfx.DrawImage(secondImage, 645, 472);
                    grfx.DrawImage(thirdImage, 645, 866);
                    grfx.DrawImage(fourthImage, 645, 1260);
                    grfx.DrawImage(foreground, 0, 0);

                    empty.Save(printPath);
                    empty.Dispose();
                }
            }
            catch (FileNotFoundException)
            {
            }
        }
Esempio n. 3
0
        static public void foreground3(string printPath)
        {
            try
            {
                var firstImage = System.Drawing.Image.FromFile(ReSize.naming(1));

                var secondImage = System.Drawing.Image.FromFile(ReSize.naming(2));

                var thirdImage = System.Drawing.Image.FromFile(ReSize.naming(3));

                string tempPath = System.IO.Path.Combine(ActualTemplateDirectory(), "foreground_3.png");

                var foreground = System.Drawing.Image.FromFile(tempPath);

                tempPath = System.IO.Path.Combine(ActualTemplateDirectory(), "empty.png");
                var empty = System.Drawing.Image.FromFile(tempPath);

                //   Bitmap changedImage = new Bitmap(Convert.ToInt32(1024), Convert.ToInt32(1024), System.Drawing.Imaging.PixelFormat.Format32bppArgb);


                using (Graphics grfx = Graphics.FromImage(empty))
                {
                    grfx.DrawImage(firstImage, 50, 80);
                    grfx.DrawImage(secondImage, 50, 492);
                    grfx.DrawImage(thirdImage, 50, 906);
                    grfx.DrawImage(firstImage, 645, 80);
                    grfx.DrawImage(secondImage, 645, 492);
                    grfx.DrawImage(thirdImage, 645, 906);
                    grfx.DrawImage(foreground, 0, 0);


                    empty.Save(printPath);
                    empty.Dispose();
                }
            }
            catch (FileNotFoundException)
            {
            }
        }