Siriuse, vcom je problem ? kreslis predsa na canvas . tak zacni kreslit kazdy graf na samostatny canvas a podla potreby si kopiruj obsah jedneho az n canvasov do toho ktory je na zobrazovanie.
Kód:
img1.Canvas.CopyMode := cmSrcAnd ; //nastavis sposob kopirovania na taky aby sa obrazky zmiesali
img1.Canvas.CopyRect(rect(20,20,250,250),img2.canvas,rect(20,20,250,250)); // a tu vykonas skopirovanie
ked budes chciet niektoru z kriviek odobrat z grafu tak iba graf znovuvyskladas z canvasov ale bez canvasu na ktorom je krivka ktoru v grafe nechces. to je aj podla mna dostatocne rychle.
edit:
narychlo zbuchana ukazka
Kód:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
img1: TImage;
img2: TImage;
img3: TImage;
chk1: TCheckBox;
chk2: TCheckBox;
img4: TImage;
chk3: TCheckBox;
procedure chk1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.chk1Click(Sender: TObject);
begin
img1.Canvas.FillRect(img1.ClientRect);
img1.Canvas.CopyMode := cmSrcAnd ;
if chk1.Checked then
img1.Canvas.CopyRect(img1.Canvas.ClipRect,img2.canvas,img1.Canvas.ClipRect);
if chk2.Checked then
img1.Canvas.CopyRect(img1.Canvas.ClipRect,img3.canvas,img1.Canvas.ClipRect);
if chk3.Checked then
img1.Canvas.CopyRect(img1.Canvas.ClipRect,img4.canvas,img1.Canvas.ClipRect);
end;
procedure TForm1.FormCreate(Sender: TObject);
var i : Integer;
begin
img1.Canvas.FillRect(img1.ClientRect);
img3.Canvas.Pen.Color := clGreen;
img4.Canvas.Pen.Color := clBlue;
img2.Canvas.MoveTo(1,20);
img3.Canvas.MoveTo(1,20);
img4.Canvas.MoveTo(1,20);
for i :=0 to 360 do begin
img2.Canvas.LineTo(i*16,20-trunc(sin(i)*16));
end;
for i :=0 to 360 do begin
img3.Canvas.LineTo(i*16,20-trunc(sin(i+5)*16));
end;
for i :=0 to 360 do begin
img4.Canvas.LineTo(i*16,20-trunc(sin(i+10)*16));
end;
end;
end.