Du malst einfach den Cursor gleich hinterher ins Bitmap. Idee nach
https://stackoverflow.com/questions/219 ... ith-delphiCode: Alles auswählen
procedure DrawCursor(ACanvas:TCanvas; Position:TPoint) ;
var
HCursor : THandle;
begin
HCursor := GetCursor;
DrawIconEx(ACanvas.Handle, Position.X, Position.Y,
HCursor, 32, 32, 0, 0, DI_NORMAL) ;
end;
function CreateBitmapFromScreenshot(WithMouse: Boolean): TBitmap;
var
screenDC: HDC;
CurPos: TPoint;
begin
Result := TBitmap.Create;
screenDC := GetDC(0);
try
Result.LoadFromDevice(screenDC);
if WithMouse then begin
GetCursorPos(CurPos);
DrawCursor(Result.Canvas, CurPos);
end;
finally
ReleaseDC(0, screenDC);
end;
end;
Benötigt die Unit Windows, aber sicher geht das auch plattformunabhängig.