Flight
2011-12-10 07:44:12
Hey there,
How difficult would it be to create a multi-layered canvas on SMART? This would make it possible to clear & refresh a certain canvas without disturbing the other(s).
Here's an example of how I might use it:
I hope this makes sense. Maybe Zyt3x or Mormonman, one of you two could throw some suggestions my way or even tell me if this is possible.
Thanks in advance.
How difficult would it be to create a multi-layered canvas on SMART? This would make it possible to clear & refresh a certain canvas without disturbing the other(s).
Here's an example of how I might use it:
Var
SecondLayer: TCanvas;
procedure SMART_DrawDotsEx(Clear: boolean; pixels: TPointArray; color: TColor; var NewCanvas);
{$IFDEF SMART}
var
i : integer;
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug();
CreateCanvas(NewCanvas); //Create a fresh canvas
NewCanvas.Pen.Color := color;
if Clear then ClearRSCanvas(NewCanvas); //Clear this canvas only
for i:= 0 to high(pixels) do
begin
NewCanvas.moveto(pixels[i].x-1,pixels[i].y);
NewCanvas.LineTo(pixels[i].x,pixels[i].y);
end;
//Maybe we need to free something here? I dunno...
{$ELSE}
begin
{$ENDIF}
end;
Procedure DrawAndClear;
begin
SMART_DrawDotsEx(False, DotArray, clRed, SecondLayer); //Draw our dots on a new canvas defined as 'SecondLayer'
if not (SecondLayer = NULL_CANVAS) then //You get the idea
ClearRSCanvas(SecondLayer);
end;
I hope this makes sense. Maybe Zyt3x or Mormonman, one of you two could throw some suggestions my way or even tell me if this is possible.
Thanks in advance.