示例#1
0
        void onMouseUp(object sender, EventArgs e)
        {
            isDragging = false;
            Point mousep = System.Windows.Forms.Cursor.Position;

            mousep = picbox.PointToClient(mousep);
            cursor_yellow.Release(mousep);
            cursor       = cursor_yellow.clone();
            cursor.color = Color.Red;
            Refresh();
        }
示例#2
0
        public RectCursor clone()
        {
            RectCursor rtn = new RectCursor(this.chip_width, this.chip_height);

            rtn.index_ori_x = this.index_ori_x;
            rtn.index_ori_y = this.index_ori_y;
            rtn.index_ter_x = this.index_ter_x;
            rtn.index_ter_y = this.index_ter_y;
            rtn.ori         = this.ori;
            rtn.ter         = this.ter;
            return(rtn);
        }
示例#3
0
        public ChipSelector(String img_name, int chip_size = 64)
        {
            this.img_name = img_name;
            InitializeComponent();
            this.AutoScroll = true;
            Image img = ImageLoader.Instance().getImage(img_name);

            this.pictureBox1.Image = img;
            this.pictureBox1.Size  = img.Size;
            this.chip_size         = chip_size;
            cursor = new RectCursor(chip_size, chip_size);
        }
示例#4
0
 public MapTabPage(String name)
 {
     this.Name = this.Text = name;
     //data = MapData.MapForTest();
     data        = new MapData();
     this.Paint += onPaint;
     picbox      = new PictureBox();
     this.Controls.Add(picbox);
     this.AutoScroll   = true;
     picbox.Paint     += this.onPaint;
     picbox.Click     += this.onClick;
     picbox.MouseMove += this.onMouseMove;
     picbox.MouseDown += this.onMouseDown;
     picbox.MouseUp   += this.onMouseUp;
     //picbox.PreviewKeyDown += this.onKeyDown;
     //this.PreviewKeyDown += this.onKeyDown;
     cursor              = new RectCursor(64, 64);
     cursor_yellow       = new RectCursor(64, 64);
     cursor_yellow.color = Color.Yellow;
     isDragging          = false;
     //selectingMapchips = true;
     selecting_type = SelectingType.Mapchip;
     billboards     = new List <Billboard>();
 }
示例#5
0
文件: Form1.cs 项目: wonderhorn/mkfj
 public void Clip(MapData data, RectCursor cursor)
 {
     clipboard.setChips(data, cursor.OriginalIndex().Item1, cursor.OriginalIndex().Item2
                        , cursor.TerminalIndex().Item1 - cursor.OriginalIndex().Item1 + 1
                        , cursor.TerminalIndex().Item2 - cursor.OriginalIndex().Item2 + 1);
 }