Пример #1
0
		public static Cursor CreateCursor(Bitmap bmp, int xHotSpot, int yHotSpot)
		{
			IntPtr ptr = bmp.GetHicon();
			NativeMethods.IconInfo tmp = new NativeMethods.IconInfo();
			NativeMethods.GetIconInfo(ptr, ref tmp);
			tmp.xHotspot = xHotSpot;
			tmp.yHotspot = yHotSpot;
			tmp.fIcon = false;
			ptr = NativeMethods.CreateIconIndirect(ref tmp);
			return new Cursor(ptr);
		}
Пример #2
0
        public static Cursor CreateCursor(Bitmap bmp, int xHotSpot, int yHotSpot)
        {
            IntPtr ptr = bmp.GetHicon();

            NativeMethods.IconInfo tmp = new NativeMethods.IconInfo();
            NativeMethods.GetIconInfo(ptr, ref tmp);
            tmp.xHotspot = xHotSpot;
            tmp.yHotspot = yHotSpot;
            tmp.fIcon    = false;
            ptr          = NativeMethods.CreateIconIndirect(ref tmp);
            return(new Cursor(ptr));
        }