protected override void OnMouseDown(MouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Left)
     {
         _MouseDownPoint = e.Location;
         EditValueInstance ev = this.EditValue as EditValueInstance;
         if (ev == null)
         {
             return;
         }
         if ((ev == null) || (ev.Offset == null))
         {
             initPoint = new Point(0, 0);
         }
         else
         {
             initPoint = ev.Offset;
         }
         leftMouseButtonDowned = true;
         if (!this.IsDesignMode)
         {
             this.Cursor        = HandDragCursor;
             this.Parent.Cursor = HandDragCursor;
         }
     }
     base.OnMouseDown(e);
 }
Esempio n. 2
0
        ImageWithOffsetItem CreateItem(Image t)
        {
            ImageWithOffsetItem item = new ImageWithOffsetItem();
            EditValueInstance   evi  = CreateEditvalue(t);

            item.InfoImage = evi;
            return(item);
        }
Esempio n. 3
0
        EditValueInstance CreateEditvalue(Image t)
        {
            ImageConverter    converter = new ImageConverter();
            EditValueInstance evi       = new EditValueInstance();

            byte[] res = (byte[])converter.ConvertTo(t, typeof(byte[]));
            evi.Image  = res;
            evi.Offset = new Point(0, 0);
            return(evi);
        }