home *** CD-ROM | disk | FTP | other *** search
- unit Export_Email;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Base, TeEngine, Series, ImaPoint, StdCtrls, ExtCtrls, TeeProcs, Chart;
-
- type
- TExportEmailForm = class(TBaseForm)
- Button1: TButton;
- Series1: TDeltaPointSeries;
- Button2: TButton;
- procedure Button1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- implementation
-
- {$R *.dfm}
-
- Uses TeExport, TeeJPEG, TeeConst;
-
- procedure TExportEmailForm.Button1Click(Sender: TObject);
- begin
- TeeExport(Self,Chart1);
- end;
-
- procedure TExportEmailForm.FormCreate(Sender: TObject);
- begin
- inherited;
- Series1.FillSampleValues(20);
- end;
-
- procedure TExportEmailForm.Button2Click(Sender: TObject);
- type TPathName=Array[0..MAX_PATH] of Char;
- var tmpPath,
- tmpName : TPathName;
- begin
- { obtain the "temp" folder path... }
- if GetTempPath(MAX_PATH,tmpPath)=0 then
- Raise Exception.Create(TeeMsg_CanNotFindTempPath);
-
- { set the filename to "\temp\teechart.jpg" }
- StrPCopy(tmpName,StrPas(tmpPath)+'\TeeChart.jpg');
-
- { create the JPEG chart... }
- With TJPEGExportFormat.Create do
- try
- Panel:=Chart1;
- SaveToFile(tmpName);
- finally
- Free;
- end;
-
- { email the jpeg chart... }
- TeeEmailFile(tmpName);
-
- { delete the temporary jpeg file... }
- DeleteFile(tmpName);
- end;
-
- initialization
- RegisterClass(TExportEmailForm);
- end.
-