Ejemplo n.º 1
0
        async private void BUTT_RR_Click(object sender, EventArgs e)
        {
            try{
                ImageListView CurrentView = GetCurrentView();

                foreach (ImageListViewItem im in CurrentView.SelectedItems)
                {
                    ImageLocationAndExtraInfo tmpinfo = ImageGroup.FullImageList.Find(x => x.PathToSmallImage.Contains(Path.GetFileName(im.FileName)));

                    tmpinfo.RightCrop = tmpinfo.RightCrop + 50;
                    if (tmpinfo.RightCrop >= 795)
                    {
                        tmpinfo.RightCrop = 794;
                    }
                    else if (tmpinfo.RightCrop <= tmpinfo.LeftCrop)
                    {
                        tmpinfo.RightCrop = tmpinfo.LeftCrop;
                    }

                    tmpinfo = await this.ParentForm.SaveGrayedOutImage(tmpinfo, tmpinfo.LeftCrop, tmpinfo.RightCrop, tmpinfo.brightnessCorrection);

                    im.Update();
                }
                SaveProgress();
            }
            catch (Exception error) {
                this.ParentForm.AppendLogTextBox("\n\n****ERROR***\n" + error.Message);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ImageListViewCacheThumbnail"/> class.
        /// </summary>
        /// <param name="owner">The owner control.</param>
        public ImageListViewCacheThumbnail(ImageListView owner)
        {
            context                = null;
            bw                     = new QueuedBackgroundWorker();
            bw.ProcessingMode      = ProcessingMode.LIFO;
            bw.IsBackground        = true;
            bw.DoWork             += bw_DoWork;
            bw.RunWorkerCompleted += bw_RunWorkerCompleted;

            checkProcessingCallback = new SendOrPostCallback(CanContinueProcessing);

            mImageListView        = owner;
            diskCache             = new DiskCache(string.Empty, 100 * 1024 * 1024, DiskCache.SyncBehavior.SyncNone, 32);
            CacheMode             = CacheMode.OnDemand;
            CacheLimitAsItemCount = 0;
            CacheLimitAsMemory    = 20 * 1024 * 1024;
            RetryOnError          = false;

            thumbCache             = new Dictionary <Guid, CacheItem>();
            editCache              = new Dictionary <Guid, bool>();
            processing             = new Dictionary <Guid, bool>();
            processingRendererItem = Guid.Empty;
            processingGalleryItem  = Guid.Empty;

            rendererItem = null;
            galleryItem  = null;

            MemoryUsed          = 0;
            MemoryUsedByRemoved = 0;
            removedItems        = new List <Guid>();

            disposed = false;
        }
Ejemplo n.º 3
0
        async private void CropImageLeft(object sender, EventArgs e)
        {
            try
            {
                MenuItem MI = (MenuItem)sender;

                ImageListView CurrentView = GetCurrentView();


                foreach (ImageListViewItem im in CurrentView.SelectedItems)
                {
                    ImageLocationAndExtraInfo tmpinfo = ImageGroup.FullImageList.Find(x => x.PathToSmallImage.Contains(Path.GetFileName(im.FileName)));

                    tmpinfo.LeftCrop = tmpinfo.LeftCrop + int.Parse(MI.Text) / 10;;
                    if (tmpinfo.LeftCrop >= tmpinfo.RightCrop)
                    {
                        tmpinfo.LeftCrop = tmpinfo.RightCrop - 1;
                    }
                    else if (tmpinfo.LeftCrop < 0)
                    {
                        tmpinfo.LeftCrop = 0;
                    }


                    tmpinfo = await this.ParentForm.SaveGrayedOutImage(tmpinfo, tmpinfo.LeftCrop, tmpinfo.RightCrop, tmpinfo.brightnessCorrection);

                    im.Update();
                }
                SaveProgress();
            }
            catch (Exception ER)
            {
                this.ParentForm.AppendLogTextBox("FAILED to recrop images \n***ERROR***\n" + ER.Message);
            }
        }
        /// <summary>
        /// Initializes a new instance of the ImageListViewActionLists class.
        /// </summary>
        /// <param name="component">A component related to the DesignerActionList.</param>
        public ImageListViewActionLists(IComponent component)
            : base(component)
        {
            imageListView = (ImageListView)component;

            designerService = (DesignerActionUIService)GetService(typeof(DesignerActionUIService));
        }
 /// <summary>
 /// Initializes a new instance of the ImageListViewItemCollection class.
 /// </summary>
 /// <param name="owner">The ImageListView owning this collection.</param>
 internal ImageListViewItemCollection(ImageListView owner)
 {
     //lock (mImageListView.itemLock)
     mItems         = new List <ImageListViewItem>();
     mFocused       = null;
     mImageListView = owner;
 }
        /// <summary>
        /// Initializes a new instance of the ImageListViewCacheManager class.
        /// </summary>
        /// <param name="owner">The owner control.</param>
        public ImageListViewCacheManager(ImageListView owner)
        {
            lockObject = new object();

            mImageListView         = owner;
            mCacheMode             = CacheMode.OnDemand;
            mCacheLimitAsItemCount = 0;
            mCacheLimitAsMemory    = 20 * 1024 * 1024;
            mRetryOnError          = owner.RetryOnError;

            toCache    = new Stack <CacheItem>();
            thumbCache = new Dictionary <Guid, CacheItem>();
            editCache  = new Dictionary <Guid, Image>();

            rendererToCache = new Stack <CacheItem>();
            rendererGuid    = new Guid();
            rendererItem    = null;

            memoryUsed          = 0;
            memoryUsedByRemoved = 0;
            removedItems        = new List <Guid>();

            mThread = new Thread(new ThreadStart(DoWork));
            mThread.IsBackground = true;

            stopping = false;
            stopped  = false;
            disposed = false;

            mThread.Start();
            while (!mThread.IsAlive)
            {
                ;
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImageListViewCacheThumbnail"/> class.
        /// </summary>
        /// <param name="owner">The owner control.</param>
        public ImageListViewCacheThumbnail(ImageListView owner)
        {
            context = null;
            bw      = new QueuedBackgroundWorker
            {
                ProcessingMode = ProcessingMode.FIFO,
                IsBackground   = true,
                ThreadName     = "Thumbnail Cache Worker Thread"
            };
            bw.DoWork             += Bw_DoWork;
            bw.RunWorkerCompleted += Bw_RunWorkerCompleted;

            checkProcessingCallback = new SendOrPostCallback(CanContinueProcessing);

            mImageListView        = owner;
            CacheMode             = CacheMode.OnDemand;
            CacheLimitAsItemCount = 0;
            CacheLimitAsMemory    = 20 * 1024 * 1024;
            RetryOnError          = false;

            thumbCache             = new Dictionary <Guid, CacheItem>();
            editCache              = new Dictionary <Guid, bool>();
            processing             = new Dictionary <Guid, bool>();
            processingRendererItem = Guid.Empty;
            processingGalleryItem  = Guid.Empty;

            rendererItem = null;
            galleryItem  = null;

            MemoryUsed          = 0;
            MemoryUsedByRemoved = 0;
            removedItems        = new List <Guid>();

            disposed = false;
        }
 public static void ImageListViewAddItem(ImageListView imageListView, string fullFileName, ref bool hasTriggerLoadAllMetadataActions, ref HashSet <string> keepTrackOfLoadedMetadata)
 {
     hasTriggerLoadAllMetadataActions = false;
     keepTrackOfLoadedMetadata.Add(fullFileName);
     imageListView.Items.Add(fullFileName);
     ClearCacheFileEntries(imageListView);
 }
        private void AddDetectedFacesToListViewPanel()
        {
            try
            {
                if (its_time_to_pick_perpetrator_faces)
                {
                    if (detected_faces != null && current_frame != null)
                    {
                        ImageListView image_list_view = Singleton.SELECT_PERP_FACES.GetImageListView();

                        for (int i = 0; i < detected_faces.Length; i++)
                        {
                            //get face
                            Image <Bgr, byte> face = FramesManager.CropSelectedFace(detected_faces[i], current_frame.Clone());

                            //resize face
                            face = FramesManager.ResizeColoredImage(face, new Size(120, 120));

                            //add face to image list
                            Singleton.SELECT_PERP_FACES.suspect_faces.TryAdd(count, face);

                            //add face to image list view
                            image_list_view.Invoke(new AddImage(Singleton.SELECT_PERP_FACES.AddImage), new object[] { "face " + count, "face " + count, face.ToBitmap() });

                            //increment id counter
                            count++;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }
Ejemplo n.º 10
0
        async private void BUTT_REFRESH_Click(object sender, EventArgs e)
        {
            ImageListView CurrentView = GetCurrentView();

            if (CurrentView.SelectedItems.Count == 0)
            {
                foreach (ImageListViewItem item in CurrentView.Items)
                {
                    ImageLocationAndExtraInfo tmpinfo = ImageGroup.FullImageList.Find(x => x.PathToSmallImage.Contains(Path.GetFileName(item.FileName)));
                    tmpinfo = await this.ParentForm.CreateSmallImages(tmpinfo);

                    tmpinfo = await this.ParentForm.SaveGrayedOutImage(tmpinfo, tmpinfo.LeftCrop, tmpinfo.RightCrop, tmpinfo.brightnessCorrection);

                    item.Update();
                }
            }
            else
            {
                foreach (ImageListViewItem item in CurrentView.SelectedItems)
                {
                    ImageLocationAndExtraInfo tmpinfo = ImageGroup.FullImageList.Find(x => x.PathToSmallImage.Contains(Path.GetFileName(item.FileName)));
                    tmpinfo = await this.ParentForm.CreateSmallImages(tmpinfo);

                    tmpinfo = await this.ParentForm.SaveGrayedOutImage(tmpinfo, tmpinfo.LeftCrop, tmpinfo.RightCrop, tmpinfo.brightnessCorrection);

                    item.Update();
                }
            }
        }
Ejemplo n.º 11
0
        async private void RemapSingleAltDialog(object sender, EventArgs e)
        {
            ImageListView CurrentView = GetCurrentView();

            using (var form = new AltRemapSingleDialog())
            {
                //determine which view is open
                var result = form.ShowDialog();
                if (result == DialogResult.OK)
                {
                    float newalt = form.newValue;

                    foreach (ImageListViewItem Item in CurrentView.SelectedItems)
                    {
                        ImageLocationAndExtraInfo tmpinfo = ImageGroup.FullImageList.Find(x => x.PathToSmallImage.Contains(Path.GetFileName(Item.FileName)));
                        tmpinfo.Altitude = newalt;
                        tmpinfo          = await this.ParentForm.SaveGrayedOutImage(tmpinfo, tmpinfo.LeftCrop, tmpinfo.RightCrop, tmpinfo.brightnessCorrection);

                        Item.Update();
                    }
                }
            }

            SaveProgress();
        }
Ejemplo n.º 12
0
            /// <summary>
            /// Initializes a new instance of the ImageListViewNavigationManager class.
            /// </summary>
            /// <param name="owner">The owner control.</param>
            public ImageListViewNavigationManager(ImageListView owner)
            {
                mImageListView = owner;

                DraggingSeperator = false;
                ResizingPane      = false;

                LeftButton  = false;
                RightButton = false;
                ShiftKey    = false;
                ControlKey  = false;

                HoveredItem = null;

                HoveredPaneBorder = false;

                MouseSelecting = false;

                DropTarget   = null;
                DropToRight  = false;
                selfDragging = false;

                highlightedItems = new Dictionary <ImageListItem, bool>();

                scrollTimer          = new System.Windows.Forms.Timer();
                scrollTimer.Interval = 100;
                scrollTimer.Enabled  = false;
                scrollTimer.Tick    += new EventHandler(scrollTimer_Tick);

                suppressClick = false;
            }
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageListViewItemCollection"/>  class.
 /// </summary>
 /// <param name="owner">The <see cref="ImageListView"/> owning this collection.</param>
 internal ImageListViewItemCollection(ImageListView owner)
 {
     mItems             = new List <ImageListViewItem>();
     lookUp             = new Dictionary <Guid, ImageListViewItem>();
     mFocused           = null;
     mImageListView     = owner;
     collectionModified = true;
 }
Ejemplo n.º 14
0
        private void BindData()
        {
            List <SqlParameter> parms = new List <SqlParameter>();

            parms.Add(new SqlParameter("@PNUM", 20));
            ImageListView.DataSource = DB.Get("dbo.ImageItemsSelect", parms.ToArray());
            ImageListView.DataBind();
        }
 public static HashSet <string> GetFilesSelectedItemsCache(ImageListView imageListView)
 {
     if (imageListViewSelectedFilesCache == null)
     {
         GetFileEntriesSelectedItemsCache(imageListView, false);
     }
     return(imageListViewSelectedFilesCache);
 }
Ejemplo n.º 16
0
        private void ShowAltinLowerLeftCorner(object sender, EventArgs e)
        {
            ImageListView ImageView = (ImageListView)sender;

            if (ImageView.SelectedItems.Count > 0)
            {
                ALT_TEXT_HELP.Text = "Altitude:" + this.ImageGroup.FullImageList.Find(x => x.PathToSmallImage.Contains(Path.GetFileName(ImageView.SelectedItems[0].FileName))).Altitude.ToString("G4");
            }
        }
Ejemplo n.º 17
0
        public ClicksHelper(ImageListView imageListView)
        {
            this.imageListView              = imageListView;
            this.imageListView.KeyDown     += ListView1_KeyDown;
            this.imageListView.DoubleClick += listView1_DoubleClick;
            this.imageListView.ItemClick   += ImageListView_ItemClick;

            this.imageListView.ThumbnailSize = new Size(size, size * 9 / 16);
        }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageListViewGroup"/>  class.
 /// </summary>
 /// <param name="name">The name of the group.</param>
 /// <param name="firstItemIndex">The index of the first item.</param>
 /// <param name="lastItemIndex">The index of the last item.</param>
 internal ImageListViewGroup(string name, int firstItemIndex, int lastItemIndex)
 {
     mImageListView = null;
     owner          = null;
     Name           = name;
     mCollapsed     = false;
     FirstItemIndex = firstItemIndex;
     LastItemIndex  = lastItemIndex;
 }
Ejemplo n.º 19
0
        private void MoveImageToPass(object sender, EventArgs e)
        {
            try
            {
                MenuItem MI = (MenuItem)sender;

                ImageListView CurrentView = GetCurrentView();

                foreach (ImageListViewItem im in CurrentView.SelectedItems)
                {
                    ImageLocationAndExtraInfo tmpinfo = ImageGroup.FullImageList.Find(x => x.PathToSmallImage.Contains(Path.GetFileName(im.FileName)));

                    tmpinfo.selected = true;

                    this.ParentForm.SaveGrayedOutImage(tmpinfo, tmpinfo.LeftCrop, tmpinfo.RightCrop, tmpinfo.brightnessCorrection);
                    switch (MI.Text)
                    {
                    case "1":
                        tmpinfo.Type = ImageLocationType.Pass1;
                        Images_pass1.Items.Add(tmpinfo.PathToGreyImage);
                        SortPassImagesbyName(Images_pass1);
                        break;

                    case "2":
                        tmpinfo.Type = ImageLocationType.Pass2;
                        Images_pass2.Items.Add(tmpinfo.PathToGreyImage);
                        SortPassImagesbyName(Images_pass2);
                        break;

                    case "3":
                        tmpinfo.Type = ImageLocationType.Pass3;
                        Images_pass3.Items.Add(tmpinfo.PathToGreyImage);
                        SortPassImagesbyName(Images_pass3);
                        break;

                    case "4":
                        tmpinfo.Type = ImageLocationType.Pass4;
                        Images_pass4.Items.Add(tmpinfo.PathToGreyImage);
                        SortPassImagesbyName(Images_pass4);
                        break;

                    case "5":
                        tmpinfo.Type = ImageLocationType.Pass5;
                        Images_pass5.Items.Add(tmpinfo.PathToGreyImage);
                        SortPassImagesbyName(Images_pass5);
                        break;
                    }
                    CurrentView.Items.Remove(im);
                }
                SaveProgress();
                UpdateImageNumber();
            }
            catch (Exception ER) {
                this.ParentForm.AppendLogTextBox("FAILED while moving images to pass tab " + this.ImageGroup.BaseDirectory + "\n***ERROR***\n" + ER.Message);
            }
        }
Ejemplo n.º 20
0
 public DragDropHelper(ImageListView listView1, Form form)
 {
     this.form      = form;
     this.listView1 = listView1;
     //listView1.AllowDrop = true;
     listView1.AllowDrag          = true;
     listView1.QueryContinueDrag += ListView1_QueryContinueDrag;
     listView1.DragEnter         += ListView1_DragEnter;
     listView1.DragLeave         += ListView1_DragLeave;
 }
Ejemplo n.º 21
0
        public static List <ColumnNameAndWidth> GetColumnNameAndWidths(ImageListView imageListView)
        {
            List <ColumnNameAndWidth> columnNameAndWidths = new List <ColumnNameAndWidth>();

            foreach (ImageListView.ImageListViewColumnHeader item in imageListView.Columns)
            {
                columnNameAndWidths.Add(new ColumnNameAndWidth(item.Text, item.Width));
            }
            return(columnNameAndWidths);
        }
 private void Construct(MainFlowCoordinator mainFlowCoordinator, ImageListView imageListView,
                        SettingsView settingsView, PluginConfig config, PillowSpawner pillowSpawner, Initializer initializer)
 {
     _mainFlowCoordinator = mainFlowCoordinator;
     _imageListView       = imageListView;
     _settingsView        = settingsView;
     _config        = config;
     _pillowSpawner = pillowSpawner;
     _initializer   = initializer;
 }
        public static void ClearAllAndCaches(ImageListView imageListeView)
        {
            imageListeView.ClearSelection();
            imageListeView.Items.Clear();
            imageListeView.ClearThumbnailCache();
            imageListeView.Refresh();

            ClearCacheFileEntries(imageListeView);
            ClearCacheFileEntriesSelectedItems(imageListeView);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Initializes a new instance of the ImageListViewLayoutManager class.
        /// </summary>
        /// <param name="owner">The owner control.</param>
        public ImageListViewLayoutManager(ImageListView owner)
        {
            mImageListView     = owner;
            cachedVisibleItems = new Dictionary <Guid, bool>();

            vScrollVisible = false;
            hScrollVisible = false;

            Update();
        }
Ejemplo n.º 25
0
            void infoTimer_Tick(object sender, EventArgs e)
            {
                current++;
                if (current == infoTexts.Length)
                {
                    current = 0;
                }

                ImageListView.Refresh();
            }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the ImageListViewColumnHeader class.
 /// </summary>
 /// <param name="type">The type of data to display in this column.</param>
 /// <param name="text">Text of the column header.</param>
 /// <param name="width">Width in pixels of the column header.</param>
 public ImageListViewColumnHeader(ColumnType type, string text, int width)
 {
     mImageListView = null;
     owner          = null;
     mText          = text;
     mType          = type;
     mWidth         = width;
     mVisible       = true;
     mDisplayIndex  = -1;
 }
Ejemplo n.º 27
0
 public DisplayRendererHelper(ImageListView imageListView, ComboBox comboBox)
 {
     this.imageListView = imageListView;
     this.imageListView.Columns.Add(ColumnType.Name);
     this.imageListView.Columns.Add(ColumnType.Dimensions);
     this.imageListView.Columns.Add(ColumnType.FileSize);
     this.imageListView.Columns.Add(ColumnType.FolderName);
     this.imageListView.Columns.Add(ColumnType.DateModified);
     this.imageListView.AllowItemReorder = false;
     comboBox.SelectedIndexChanged      += cboStyle_SelectedIndexChanged;
 }
 public ImageListViewController(ImageListView imageListView)
 {
     _imageListView                     = imageListView;
     _imageListView.AllowDrop           = false;
     _imageListView.AllowMultiSelection = true;
     _getImage = new ImageListViewItem.GetImageHandler((key) =>
     {
         ImageResourceInfo resourceInfo = (ImageResourceInfo)key;
         return(resourceInfo.GetImage());
     });
 }
            /// <summary>
            /// Initializes a new instance of the ImageListViewColumnHeaderCollection class.
            /// </summary>
            /// <param name="owner">The owner control.</param>
            internal ImageListViewColumnHeaderCollection(ImageListView owner)
            {
                mImageListView = owner;
                // Create the default column set
                mItems = new ImageListViewColumnHeader[] {
                    //JTN: Added more columns
                    //JTN: MediaFileAttributes
                    #region Add column types to List
                    new ImageListViewColumnHeader(ColumnType.FileName),
                    new ImageListViewColumnHeader(ColumnType.FileDate),
                    new ImageListViewColumnHeader(ColumnType.FileSmartDate),
                    new ImageListViewColumnHeader(ColumnType.FileDateCreated),
                    new ImageListViewColumnHeader(ColumnType.FileDateModified),
                    new ImageListViewColumnHeader(ColumnType.MediaDateTaken),
                    new ImageListViewColumnHeader(ColumnType.LocationDateTime),
                    new ImageListViewColumnHeader(ColumnType.LocationTimeZone),

                    new ImageListViewColumnHeader(ColumnType.FileType),
                    new ImageListViewColumnHeader(ColumnType.FileFullPath),
                    new ImageListViewColumnHeader(ColumnType.FileDirectory),
                    new ImageListViewColumnHeader(ColumnType.FileSize),
                    new ImageListViewColumnHeader(ColumnType.FileStatus),

                    new ImageListViewColumnHeader(ColumnType.MediaAlbum),
                    new ImageListViewColumnHeader(ColumnType.MediaTitle),
                    new ImageListViewColumnHeader(ColumnType.MediaDescription),
                    new ImageListViewColumnHeader(ColumnType.MediaComment),
                    new ImageListViewColumnHeader(ColumnType.MediaAuthor),
                    new ImageListViewColumnHeader(ColumnType.MediaRating),

                    new ImageListViewColumnHeader(ColumnType.LocationName),
                    new ImageListViewColumnHeader(ColumnType.LocationRegionState),
                    new ImageListViewColumnHeader(ColumnType.LocationCity),
                    new ImageListViewColumnHeader(ColumnType.LocationCountry),

                    new ImageListViewColumnHeader(ColumnType.CameraMake),
                    new ImageListViewColumnHeader(ColumnType.CameraModel),

                    new ImageListViewColumnHeader(ColumnType.MediaDimensions)
                    #endregion
                };

                for (int i = 0; i < mItems.Length; i++)
                {
                    ImageListViewColumnHeader col = mItems[i];
                    col.mImageListView = mImageListView;
                    col.owner          = this;
                    col.DisplayIndex   = i;
                    if (i >= 4)
                    {
                        col.Visible = false;
                    }
                }
            }
 /// <summary>
 /// Initializes a new instance of the ImageListViewColumnHeader class.
 /// </summary>
 /// <param name="type">The type of data to display in this column.</param>
 /// <param name="text">Text of the column header.</param>
 /// <param name="width">Width in pixels of the column header.</param>
 /// <param name="displayIndex">Display order of the column.</param>
 /// <param name="visible">Whether the column is initially visible.</param>
 public ImageListViewColumnHeader(ColumnType type, string text, int width, int displayIndex, bool visible)
 {
     mImageListView = null;
     owner          = null;
     mGuid          = Guid.NewGuid();
     mText          = text;
     mType          = type;
     mWidth         = width;
     mVisible       = visible;
     mDisplayIndex  = displayIndex;
 }
Ejemplo n.º 31
0
 private void thumbnailBar_ItemClick(object sender, ImageListView.ItemClickEventArgs e)
 {
     GlobalSetting.CurrentIndex = e.Item.Index;
     NextPic(0);
 }