TCursorImage.SetHotSpot is missing - can't set hotspot for custom cursors
Original Reporter info from Mantis: dezlov
-
Reporter name: Denis Kozlov
Original Reporter info from Mantis: dezlov
- Reporter name: Denis Kozlov
Description:
TCursorImage allows using a custom image as a cursor, however, there seems to be no way to set the HotSpot for the cursor (the pointer position of the icon).
There is a TCursorImage.HotSpot property which is read-only via TCursorImage.GetHotSpot method, but there is no TCursorImage.SetHotSpot method.
I also found this old thread which also suggested to add a bug report about not being able to set the hotspot:
http://forum.lazarus.freepascal.org/index.php?topic=5830.0
Sample code in "Additional Information" section.
Additional information:
Sample code to load a custom cursor image:
----------------------------------------------------------
var
CustomCursorImage: TCursorImage;
const
crCustomCursor: TCursor = crHigh + 1;
procedure TForm1.FormCreate(Sender: TObject);
begin
CustomCursorImage := TCursorImage.Create;
CustomCursorImage.LoadFromFile('example.ico');
Screen.Cursors[crCustomCursor] := CustomCursorImage.ReleaseHandle;
Screen.Cursor := crCustomCursor;
end;
----------------------------------------------------------
Mantis conversion info:
- Mantis ID: 26945
- OS: Windows
- Build: Lazarus 1.2.4 r45510 FPC 2.6.4
- Version: 1.2.4
- Fixed in revision: r46685 (#54e3e1bc)
- Monitored by: » dezlov (Denis Kozlov)