I'm using this TCanvas to draw cursors for my mice
Canv := TCanvas.Create;
Canv.Handle := GetWindowDC(0);
.... For every mice event do the following
Bitmap:=TBitmap.Create;
CursorInfo.cbSize := sizeof(CursorInfo);
GetCursorInfo(CursorInfo);
Bitmap.Width := 32;
Bitmap.Height := 32;
Bitmap.Transparent:=true;
DrawIconEx(Bitmap.Canvas.Handle, 0,0, CursorInfo.hCursor, 32,32, 0,0, DI_NORMAL) ;
Bitmap.Canvas.Brush.Color := RGB(250,250,250);
Bitmap.Canvas.FloodFill(31,0, clWhite, fsSurface);
Bitmap.Canvas.FloodFill(0,0, clWhite, fsSurface);
currentX:=getcurrentxpos;
currentY:=getcurrentypos;
Canv.Draw(currentX,currentY,Bitmap);
Bitmap.Free;
The problem is instead of just showing the individual cursors, it makes mouse trails. Can I clear the whole Canvas evertime a mouse moves? (doesn't sound like a good idea though). Maybe I could clear my previous Canv.Draw
by doing the reverse of that code (if it is possible)? Any suggestions as to how I can show the cursors?
EDIT:
tried inserting another Canv.Draw(currentX,currentY,Bitmap);
just after setting the bitmap width and height...and now the problem is I have a white trail (rather than a mouse trail), much cleaner but still no good.