ReDraw Canvas without using Invalidate
Hello FRers,
I want to ReDraw only one memo on the EMFPages,
ie : Change the Text into 'abc'.
If I use PaintBox.Invalidate, it will change, but the problem is the page is become blinking.. because it change whole of the canvas area.
So, i want to try to only Redraw just for that memoView that want to change..
Can i get the solution of it?
I already try to make it but it won't change until i call Invalidate..
procedure RedrawView( iView : TfrView); //on TPBox
begin
TfrMemoView(iView).Memo.Text := 'abc';
TfrMemoView(iView).Draw(Canvas);
end;
Thanx a lot for any comment
I want to ReDraw only one memo on the EMFPages,
ie : Change the Text into 'abc'.
If I use PaintBox.Invalidate, it will change, but the problem is the page is become blinking.. because it change whole of the canvas area.
So, i want to try to only Redraw just for that memoView that want to change..
Can i get the solution of it?
I already try to make it but it won't change until i call Invalidate..
procedure RedrawView( iView : TfrView); //on TPBox
begin
TfrMemoView(iView).Memo.Text := 'abc';
TfrMemoView(iView).Draw(Canvas);
end;
Thanx a lot for any comment
Comments
procedure TPBox.ReDraw_View(iView: TObject);
var
vRect : TRect;
vMemoText : String;
begin
//refresh the background
if (iView is TfrMemoView) then begin
vRect := Rect( TfrMemoView(iView).DRect.Left,
TfrMemoView(iView).DRect.Top + TfrMemoView(iView).gapy,
TfrMemoView(iView).DRect.Right,
TfrMemoView(iView).DRect.Bottom );
Canvas.FillRect(vREct);
//fill the new text
TfrMemoView(iView).Memo.Text := 'abc';
TfrMemoView(iView).Draw(Canvas);
end;
end;
The first problem caused, because i forgot to refresh the canvas, it make the previous text didn't refresh. After i call FillRect, it refresh to blank canvas.
And after that i just call Draw to make the new Text.