Ejemplo n.º 1
0
        public EditorDataSet(IDataSet dataSet) :
            base(dataSet)
        {
            SortedSet <string> setLabels = new SortedSet <string>();

            Images = new List <EditorImage>();

            foreach (DataImage dImg in DlibObject.Images)
            {
                EditorImage wrappedImage = new EditorImage(dImg);
                Images.Add(wrappedImage);

                foreach (EditorBox b in wrappedImage.Boxes)
                {
                    if (!string.IsNullOrEmpty(b.Label))
                    {
                        if (!setLabels.Contains(b.Label))
                        {
                            setLabels.Add(b.Label);
                        }
                    }
                }
            }

            Labels = setLabels.ToArray();
        }
Ejemplo n.º 2
0
        public EditorImage AddImage(string fileName)
        {
            DataImage dImg = new DataImage
            {
                File  = fileName,
                Boxes = new List <DataBox>()
            };

            EditorImage edImg = new EditorImage(dImg);

            DlibObject.Images.Add(dImg);
            Images.Add(edImg);

            return(edImg);
        }
Ejemplo n.º 3
0
        public Bitmap ChangeState(EditorImage img)
        {
            if (mState is UnselectedBoxState)
            {
                mState     = SelectedBoxState.Instance;
                IsSelected = true;
            }
            else
            {
                mState     = UnselectedBoxState.Instance;
                IsSelected = false;
            }

            StateChanged?.Invoke(this, new EditorBoxStateChangedEventArgs(mState));

            return(Render(mState.Render(img.Render(), this)));
        }