示例#1
0
        remCursorBadge()
        {
            var cbu = new CursorBadgeUtilities();

            if (cbu.HasSupplementalCursorImage() && _img != null)
            {
                cbu.RemoveSupplementalCursorImage(_img);
            }
        }
示例#2
0
        addCursorBadge()
        {
            Point[] pnts = new Point[17] {
                new Point(0, 0),
                new Point(1, 0),
                new Point(15, 15),
                new Point(29, 0),
                new Point(30, 0),
                new Point(30, 1),
                new Point(16, 15),
                new Point(30, 29),
                new Point(30, 30),
                new Point(29, 30),
                new Point(15, 16),
                new Point(1, 30),
                new Point(0, 30),
                new Point(0, 29),
                new Point(14, 15),
                new Point(0, 1),
                new Point(0, 0)
            };

            if (_img == null)
            {
                using (var bmp = new Bitmap(30, 30)){
                    using (var g = Graphics.FromImage(bmp)){
                        g.Clear(Color.Magenta);
                        g.FillPolygon(Brushes.Red, pnts);
                    }
                    _img = Utils.ConvertBitmapToAcGiImageBGRA32(bmp);
                }
            }
            var cbu = new CursorBadgeUtilities();

            cbu.AddSupplementalCursorImage(_img, 3);
        }
示例#3
0
 /// <summary>
 /// Добавление значка с приоритетом 1 означает, что
 /// он не будет виден при операциях выбора. Изменение
 /// этого значения в 3 достаточно, чтобы и при операциях
 /// выбора был виден наш значок (большее значение
 /// еще увеличит шансы на то, что он останется видимым)
 /// </summary>
 /// <param name="image">Иконка</param>
 /// <param name="priority">Приоритет</param>
 public CursorBadgeUsing([NotNull] ImageBGRA32 image, int priority = 1)
 {
     this.image = image;
     cbu        = new CursorBadgeUtilities();
     cbu.AddSupplementalCursorImage(image, priority);
 }