Hallo,
ich habe eine Bitmap-Datei, die ich bei einem Drag&Drop Vorgang als Cursor verwenden möchte. Das mache ich im Moment so:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
| procedure TfrmMain.CreateCursor(); var bmpMask, bmpColor : TBitmap; iiIconInfo : TIconInfo; begin bmpMask := TBitmap.Create(); bmpColor := TBitmap.Create();
try bmpMask.LoadFromFile( ExtractFilePath(ParamStr(0)) + '\cursor\list_drag_small.bmp' ); bmpColor.LoadFromFile( ExtractFilePath(ParamStr(0)) + '\cursor\list_drag_small.bmp' );
with iiIconInfo do begin fIcon := false; xHotspot := 15; yHotspot := 15; hbmMask := bmpMask.Handle; hbmColor := bmpColor.Handle; end;
Screen.Cursors[crLVDrag] := CreateIconIndirect(iiIconInfo); finally bmpMask.Free(); bmpColor.Free(); end; end; |
Das Problem dabei ist, dass rund um meinen Cursor ein viereckiger schwarzer Hintergrund ist.