Exemplo n.º 1
0
        private static void testCombineImages()
        {
            Image i1       = ImageFileIO.ImageFromFile(@"C:\Users\chance\Documents\Visual Studio 2015\Capstone\HollisC_Collage\SimpleCollage\SimpleCollage\images\needle.jpg");
            Image i2       = ImageFileIO.ImageFromFile(@"C:\Users\chance\Documents\Visual Studio 2015\Capstone\HollisC_Collage\SimpleCollage\SimpleCollage\images\BigName.bmp");
            Image Combined = ImageCombiner.Combine(i1, i2);

            ImageFileIO.saveImageToFile(Combined, @"C:\Users\chance\Documents\Visual Studio 2015\Capstone\HollisC_Collage\SimpleCollage\SimpleCollage\createdImages\test1.png");
        }
Exemplo n.º 2
0
        protected void ParseMaskedEffectProperty(Node node, string name)
        {
            ImageCombiner combiner = (ImageCombiner)node;

            switch (name)
            {
            case "Enabled":
                combiner.Enabled = lexer.ParseBool();
                break;

            case "BlendMode":
                var t = ParseBlendMode();
                combiner.Blending = t.Item1;
                combiner.Shader   = t.Item2;
                break;

            default:
                ParseActorProperty(combiner, name);
                break;
            }
        }
Exemplo n.º 3
0
        private static void GenerateImagesBankSection()
        {
            Console.WriteLine("GenerateImagesBankSection");
            DBService dbServ = new DBService(null);

            dbServ.LoadDbFlatsFromFile();
            ImageCombiner imgComb = new ImageCombiner();
            int           count   = 0;

            foreach (var type in DBService.dictDbFlats)
            {
                foreach (var sect in type.Value)
                {
                    var    fi           = GetSectinByDbFlats(sect, type.Key);
                    string pathFlatsImg = Path.Combine(curDir, "00_PNG_ПИК1");
                    var    img          = imgComb.GenerateImageOneSection(fi, pathFlatsImg);
                    string file         = Path.Combine(curDir, $@"Секции\{(count++).ToString("000000")}_id-{fi.IdSection}_code-{fi.Code}_{type.Key.ToString()}.png");
                    Console.WriteLine(file);
                    img.Save(file, ImageFormat.Png);
                }
            }
        }
Exemplo n.º 4
0
        public static ImageCombinerItem TryCreate(ImageCombiner combiner)
        {
            if (combiner.Parent == null)
            {
                return(null);
            }
            var selfIndex = combiner.Parent.Nodes.IndexOf(combiner);

            if (selfIndex >= combiner.Parent.Nodes.Count - 2)
            {
                return(null);
            }
            var arg1 = combiner.Parent.Nodes[selfIndex + 1] as IImageCombinerArg;
            var arg2 = combiner.Parent.Nodes[selfIndex + 2] as IImageCombinerArg;

            if (arg1 == null || arg2 == null)
            {
                return(null);
            }

            return(new ImageCombinerItem(combiner, arg1, arg2));
        }
Exemplo n.º 5
0
 void WriteImageCombinerProperties(ImageCombiner node)
 {
     WriteNodeProperties(node);
     WriteProperty("Enabled", node.Enabled, true);
     WriteProperty("BlendMode", GetHotStudioBlending(node.Blending, node.Shader), 0);
 }
Exemplo n.º 6
0
        //public List<Image> GetImages(int maxNumImages = 50)
        //{
        //    List<Image> images = new List<Image>();

        //    for (int j = 0; j < CollageImages.Length && j < maxNumImages; j++)
        //    {
        //        Image i = CollageImages.ElementAt(j).CImage;
        //        images.Add(i);
        //    }

        //    return images;
        //}

        public void BuildCollage(string savePath)
        {
            Image completedCollage = ImageCombiner.Combine(CollageLayout, (int)ImageSize); // need to change for Image_Scale

            ImageFileIO.saveImageToFile(completedCollage, savePath);
        }
Exemplo n.º 7
0
 private ImageCombinerItem(ImageCombiner combiner, IImageCombinerArg arg1, IImageCombinerArg arg2)
 {
     Combiner = combiner;
     Arg1     = arg1;
     Arg2     = arg2;
 }