Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Image cursorImage = customImage.GetThumbnailImage(300, 100, null, IntPtr.Zero);
- cursorImage.SetResolution(96.0F, 96.0F);
- int midPointX = cursorImage.Width / 2;
- int midPointY = cursorImage.Height / 2;
- Bitmap cursorMouse = GetCursorImage(cursorOverlay);
- Graphics cursorGfx = Graphics.FromImage(cursorImageCopy);
- cursorGfx.DrawImageUnscaled(cursorMouse, midPointX, midPointY);
- Cursor tmp = new Cursor(cursorImage.GetHicon());
- public struct IconInfo
- {
- public bool fIcon;
- public int xHotspot;
- public int yHotspot;
- public IntPtr hbmMask;
- public IntPtr hbmColor;
- }
- public static Cursor CreateCursor(Bitmap bmp, int xHotSpot, int yHotSpot)
- {
- IntPtr ptr = bmp.GetHicon();
- IconInfo tmp = new IconInfo();
- GetIconInfo(ptr, ref tmp);
- tmp.xHotspot = xHotSpot;
- tmp.yHotspot = yHotSpot;
- tmp.fIcon = false;
- ptr = CreateIconIndirect(ref tmp);
- return new Cursor(ptr);
- }
Add Comment
Please, Sign In to add comment