ペイントボックスでうまく表示するには?


鳴門  2005-12-13 15:21:19  No: 19227  IP: 192.*.*.*

こんにちは、
以下のようなプログラムを作成してみました。
スクロールボックスの中にペイントボックスをいれ、
BmpData にビットマップデータを入れています。
このビットマップデータをスクロールボックスの中で
マウスを使って移動させようとしているのですが、
移動中にビットマップがパッコンパッコン、してます。
スムーズに移動するにはどうすればよいのでしょうか?

procedure TFormBMPDebugViewer.PaintBoxMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  Moving  := True;
  MovePoint := Point(X, Y);
end;

procedure TFormBMPDebugViewer.PaintBoxMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if Moving then begin
    PaintBox.Left  := PaintBox.Left + (X - MovePoint.X);
    PaintBox.Top  := PaintBox.Top  + (Y - MovePoint.Y);
  end;
end;

procedure TFormBMPDebugViewer.PaintBoxMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  Moving := False;
end;

procedure TFormBMPDebugViewer.PaintBoxPaint(Sender: TObject);
begin
  PaintBox.Canvas.StretchDraw( Rect(0, 0, PaintBox.Width, PaintBox.Height), BmpData);
end;

編集 削除
ベタな答え  2005-12-14 21:34:12  No: 19228  IP: 192.*.*.*

移動元をTImageに移し変えてTImageを移動するのはどうですか?
たぶんビットマップはいい感じで移動できると思います。
私の知恵ではこれしか出ませんでした。とほー

編集 削除