Beispiel #1
0
 public static extern IntPtr CreateIconIndirect(ref ICONINFO piconinfo);
 private static Cursor CreateCursor(Bitmap bmpColor) {
     Cursor cursor;
     using(bmpColor) {
         using(Bitmap bitmap = new Bitmap(0x20, 0x20)) {
             ICONINFO piconinfo = new ICONINFO();
             piconinfo.fIcon = false;
             piconinfo.hbmColor = bmpColor.GetHbitmap();
             piconinfo.hbmMask = bitmap.GetHbitmap();
             try {
                 cursor = new Cursor(PInvoke.CreateIconIndirect(ref piconinfo));
             }
             catch {
                 cursor = Cursors.Default;
             }
         }
     }
     return cursor;
 }
Beispiel #3
0
 public static extern IntPtr CreateIconIndirect(ref ICONINFO piconinfo);