当前位置:编程学习 > C#/ASP.NET >>

winform 设置鼠标样式 我设置成一张图片了但是 最好不要把原本的那个箭头隐藏。求大神

    public void SetCursor(Bitmap cursor, Point hotPoint)
        {
            int hotX = hotPoint.X;
            int hotY = hotPoint.Y;
            Bitmap myNewCursor = new Bitmap(cursor.Width *2 - hotX, cursor.Height*2 - hotY);
            Graphics g = Graphics.FromImage(myNewCursor);
            g.Clear(Color.FromArgb(0, 0, 0, 0));
            g.DrawImage(cursor, cursor.Width - hotX, cursor.Height - hotY, cursor.Width,
            cursor.Height);

            this.Cursor = new Cursor(myNewCursor.GetHicon());
        
            g.Dispose();
            myNewCursor.Dispose();
        } --------------------编程问答-------------------- 自己把箭头也画下去!!! --------------------编程问答-------------------- 你图片上带一个箭头不行么? --------------------编程问答--------------------
Quote: 引用 1 楼 jiangjrh 的回复:

自己把箭头也画下去!!![/quote   。。。  怎么话  求 介绍- - --------------------编程问答--------------------
引用 2 楼 gxingmin 的回复:
你图片上带一个箭头不行么?
 哥几百张图片呢  --------------------编程问答--------------------
引用 4 楼 hutianpei 的回复:
引用 2 楼 gxingmin 的回复:你图片上带一个箭头不行么? 哥几百张图片呢


 public void SetCursor(Bitmap cursor, Point hotPoint)
         {
             int hotX = hotPoint.X;
             int hotY = hotPoint.Y;
             Bitmap myNewCursor = new Bitmap(cursor.Width *2 - hotX, cursor.Height*2 - hotY);
             Graphics g = Graphics.FromImage(myNewCursor);
             g.Clear(Color.FromArgb(0, 0, 0, 0));
             g.DrawImage(cursor, cursor.Width - hotX, cursor.Height - hotY, cursor.Width,
             cursor.Height);
 
             g.DrawIcon("箭头.ico",0,0,16,16); //在这儿画一个箭头,各参数根据你实际的改 //或g.DrawImage(...);
            this.Cursor = new Cursor(myNewCursor.GetHicon());
         
             g.Dispose();
             myNewCursor.Dispose();
         }  --------------------编程问答--------------------


 public void SetCursor(Bitmap cursor, Point hotPoint)
        {
            int hotX = hotPoint.X;
            int hotY = hotPoint.Y;
            Bitmap myNewCursor = new Bitmap(cursor.Width *2 - hotX, cursor.Height*2 - hotY);
            Graphics g = Graphics.FromImage(myNewCursor);
            g.Clear(Color.FromArgb(0, 0, 0, 0));
            g.DrawImage(cursor, cursor.Width - hotX, cursor.Height - hotY, cursor.Width,
            cursor.Height);

            Cursor cur = new Cursor(myNewCursor.GetHicon());
            this.Cursor.Draw(g, ...);
            this.Cursor = cur;
        
            g.Dispose();
            myNewCursor.Dispose();
        }
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,