Example #1
0
 private static extern bool GetCursorInfo(out SpecifiedCursor pci);
Example #2
0
 private void tmrCircleClick_Tick(object sender, EventArgs e)
 {
     this._xydClientRect = FormMain.GetXYDClientRect();
     this._pci = CursorHandler.GetCursorInfo();
     int width = this.picCursor.Width;
     int height = this.picCursor.Height;
     Graphics graphics = Graphics.FromImage(this._curImage);
     try
     {
         this._cur = CursorHandler.GetWinFormCursor(this._pci);
         graphics.CopyFromScreen(new Point(this._pci.ptScreenPos.x - width / 2, this._pci.ptScreenPos.y - height / 2), new Point(0, 0), new Size(width, height));
         graphics.DrawLine(this._anglePen, (float)(width / 2), (float)(height / 2), (float)(-(float)(this._pci.ptScreenPos.x - this._xydClientRect.X - this._xydClientRect.Width / 2) + width / 2), (float)(-(float)(this._pci.ptScreenPos.y - this._xydClientRect.Y - this._xydClientRect.Height / 2) + height / 2));
         if (this._cur != null)
         {
             this._cur.Draw(graphics, new Rectangle(width / 2 - this._cur.HotSpot.X, height / 2 - this._cur.HotSpot.Y, this._cur.Size.Width, this._cur.Size.Height));
         }
     }
     catch (Exception)
     {
     }
     Color pixel = this._curImage.GetPixel(width / 2 + 18, height / 2 + 15);
     this._keyPointBrush.Color = pixel;
     graphics.FillRectangle(this._keyPointBrush, 1, 1, 9, 9);
     graphics.DrawRectangle(this._anglePen, 0, 0, 10, 10);
     if (pixel.R == 192 && pixel.G == 64 && pixel.B == 64)
     {
         this._mouseShape = "刀";
         this._emouseShape = EMouseShape.Kill;
     }
     else
     {
         if (pixel.R == 224 && pixel.G == 192 && pixel.B == 128)
         {
             this._mouseShape = "手";
             this._emouseShape = EMouseShape.Get;
         }
         else
         {
             this._mouseShape = "常";
             this._emouseShape = EMouseShape.Normal;
         }
     }
     object mouseShape = this._mouseShape;
     this._mouseShape = string.Concat(new object[]
     {
         mouseShape,
         "(",
         pixel.R,
         ",",
         pixel.G,
         ",",
         pixel.B,
         ")"
     });
     this.picCursor.Image = this._curImage;
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.xueLeft, this._xydClientRect.Y + FormMain.xueTop, FormMain.xueRight - FormMain.xueLeft + 1, 10);
         if (bmpXue == null)
         {
             bmpXue = new Bitmap(this.picXue.Width, this.picXue.Height);
             gXue = Graphics.FromImage(bmpXue);
         }
         gXue.CopyFromScreen(new Point(rectangle.X, rectangle.Y), new Point(0, 0), new Size(this.picXue.Width, this.picXue.Height));
         this.picXue.Image = bmpXue;
         Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpXue, rectangle.Width + 1 - 6, 0, false);
         this._xueNow = twoNumbers.Item1;
         this._xueFull = twoNumbers.Item2;
     }
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.lanLeft, this._xydClientRect.Y + FormMain.lanTop, FormMain.lanRight - FormMain.lanLeft + 1, 10);
         if (bmpLan == null)
         {
             bmpLan = new Bitmap(this.picLan.Width, this.picLan.Height);
             gLan = Graphics.FromImage(bmpLan);
         }
         gLan.CopyFromScreen(new Point(rectangle.X, rectangle.Y), new Point(0, 0), new Size(this.picLan.Width, this.picLan.Height));
         this.picLan.Image = bmpLan;
         Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpLan, rectangle.Width + 1 - 6, 0, false);
         this._lanNow = twoNumbers.Item1;
         this._lanFull = twoNumbers.Item2;
     }
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.tiLeft, this._xydClientRect.Y + FormMain.tiTop, FormMain.tiRight - FormMain.tiLeft + 1, 10);
         if (bmpTi == null)
         {
             bmpTi = new Bitmap(this.picTi.Width, this.picTi.Height);
             gTi = Graphics.FromImage(bmpTi);
         }
         gTi.CopyFromScreen(new Point(rectangle.X, rectangle.Y), new Point(0, 0), new Size(this.picTi.Width, this.picTi.Height));
         this.picTi.Image = bmpTi;
         Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpTi, rectangle.Width + 1 - 6, 0, false);
         this._tiNow = twoNumbers.Item1;
         this._tiFull = twoNumbers.Item2;
     }
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.renLeft, this._xydClientRect.Y + FormMain.renTop, FormMain.renRight - FormMain.renLeft + 1, 10);
         if (bmpRen == null)
         {
             bmpRen = new Bitmap(this.picRen.Width, this.picRen.Height);
             gRen = Graphics.FromImage(bmpRen);
         }
         gRen.CopyFromScreen(rectangle.Location, Point.Empty, this.picRen.Size);
         this.picRen.Image = bmpRen;
         Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpRen, 0, 0, true);
         this._renX = twoNumbers.Item1;
         this._renY = twoNumbers.Item2;
     }
     if (!this._settings._noSkill)
     {
         for (int i = 0; i < 12; i++)
         {
             var rectangle = new Rectangle(this._xydClientRect.X + FormMain.wugongMinLeft + i, this._xydClientRect.Y + FormMain.wugongTop, 53, 10);
             if (bmpWugong == null)
             {
                 bmpWugong = new Bitmap(this.picWugong.Width, this.picWugong.Height);
                 gWugong = Graphics.FromImage(bmpWugong);
             }
             gWugong.CopyFromScreen(rectangle.Location, Point.Empty, this.picWugong.Size);
             int num = NumberSign.Parse(bmpWugong, 0, 0, NumberSign._wugongNumberColor);
             if (10 > num && num >= 0)
             {
                 this.picWugong.Image = bmpWugong;
                 Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpWugong, 0, 0, true, NumberSign._wugongNumberColor);
                 this._wugongNow = twoNumbers.Item1;
                 this._wugongFull = twoNumbers.Item2;
                 break;
             }
         }
     }
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.xueYaoLeft, this._xydClientRect.Y + FormMain.xueYaoTop, FormMain.xueYaoRight - FormMain.xueYaoLeft + 1, 10);
         if (bmpXueYao == null)
         {
             bmpXueYao = new Bitmap(this.picXueYao.Width, this.picXueYao.Height);
             gXueYao = Graphics.FromImage(bmpXueYao);
         }
         gXueYao.CopyFromScreen(rectangle.Location, Point.Empty, this.picXueYao.Size);
         this.picXueYao.Image = bmpXueYao;
         Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpXueYao, 0, 0, true);
         this._xueYao = twoNumbers.Item1;
     }
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.lanYaoLeft, this._xydClientRect.Y + FormMain.lanYaoTop, FormMain.lanYaoRight - FormMain.lanYaoLeft + 1, 10);
         if (bmpLanYao == null)
         {
             bmpLanYao = new Bitmap(this.picLanYao.Width, this.picLanYao.Height);
             gLanYao = Graphics.FromImage(bmpLanYao);
         }
         gLanYao.CopyFromScreen(rectangle.Location, Point.Empty, this.picLanYao.Size);
         this.picLanYao.Image = bmpLanYao;
         Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpLanYao, 0, 0, true);
         this._lanYao = twoNumbers.Item1;
     }
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.tiYaoLeft, this._xydClientRect.Y + FormMain.tiYaoTop, FormMain.tiYaoRight - FormMain.tiYaoLeft + 1, 10);
         if (bmpTiYao == null)
         {
             bmpTiYao = new Bitmap(this.picTiYao.Width, this.picTiYao.Height);
             gTiYao = Graphics.FromImage(bmpTiYao);
         }
         gTiYao.CopyFromScreen(rectangle.Location, Point.Empty, rectangle.Size);
         this.picTiYao.Image = bmpTiYao;
         Tuple<int, int> twoNumbers = NumberSign.GetTwoNumbers(bmpTiYao, 0, 0, true);
         this._tiYao = twoNumbers.Item1;
     }
     {
         var rectangle = new Rectangle(this._xydClientRect.X + FormMain.killedOfNineLeft, this._xydClientRect.Y + FormMain.killedOfNineTop, FormMain.killedOfNineRight - FormMain.killedOfNineLeft + 1, 10);
         if (bmpShazhen == null)
         {
             bmpShazhen = new Bitmap(rectangle.Width, rectangle.Height);
             gShazhen = Graphics.FromImage(bmpShazhen);
         }
         gShazhen.CopyFromScreen(rectangle.Location, Point.Empty, rectangle.Size);
         this._killedOfNine = this.GetKilledOfNine(bmpShazhen);
         this.picShazhen.Image = this._killedOfNineImages[this._killedOfNine];
     }
     this.lblState.Text = this.ToString();
 }
Example #3
0
 public static Cursor GetWinFormCursor(SpecifiedCursor cursor)
 {
     return CursorHandler.GetWinFormCursor(cursor.hCursor);
 }