Beispiel #1
0
        private void ImportLabelFileData(List <string> files)
        {
            files.ForEach(file =>
            {
                var fileModel = new LabelFileModel()
                {
                    NameFile    = Path.GetFileName(file),
                    Path        = file,
                    UpdatedDate = File.GetLastWriteTime(file).ToString("dd/MM/yyyy"),
                    Id          = Guid.NewGuid().ToString("N"),
                };
                //listData.Add(file);
                _labelFiles.Add(fileModel);
            });
            LabelNumber.Text = _labelFiles.Count.ToString();


            //ImportLabelBtn.Text = $@"Import Label ({_labelFiles.Count})";
        }
Beispiel #2
0
        private void DrawBoundingBox(LabelFileModel label, Image currentImage)
        {
            if (label != null)
            {
                var      widthImage  = currentImage.Width;
                var      heightImage = currentImage.Height;
                Graphics g           = Graphics.FromImage(currentImage);
                Pen      p           = new Pen(Color.Green);

                var listBoundingBox = GetBoundingBoxes(label.Path, widthImage, heightImage);

                foreach (var boundingBox in listBoundingBox)
                {
                    SolidBrush sb = new SolidBrush(Color.Red);
                    g.DrawRectangle(p, boundingBox.X, boundingBox.Y, boundingBox.Width, boundingBox.Height);
                    //g.FillRectangle(sb, boundingBox.X, boundingBox.Y, boundingBox.Width, boundingBox.Height);
                }
            }
        }