zeljko
>>use LCLIntf.BeginPaint() and LCLIntf.EndPaint() to create context and everything.Maybe then it'll work.
not work((
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
{$IFDEF LCLQT}
qtwidgets,qt4,
{$ENDIF}
LCLIntf,LCLType,Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Panel1: TPanel;
procedure _onCreate(Sender: TObject);
procedure _onMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1._onMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer
);
var
PaintStruct: TPaintStruct;
begin
LCLIntf.BeginPaint(panel1.Handle,PaintStruct);
panel1.Canvas.Line(0,0,x,y);
LCLIntf.EndPaint(panel1.Handle,PaintStruct);
end;
procedure TForm1._onCreate(Sender: TObject);
begin
{$IFDEF LCLQT}
TQtWidget(Panel1.Handle).setAttribute(QtWA_PaintOutsidePaintEvent);
{$ENDIF}
end;
end.
hinst
No it is only right decision. Invalidate, and especially the timer - will antsy and torn. I need repainting while moving the mouse and not when it stops. Any missed frames worsen behavior