unit Unit1;

interface

uses
  Windows, ComCtrls,Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeeURL, TeeNavigator, TeeEdiGene, Grids, TeeChartGrid,
  TeePreviewPanel, TeeGalleryPanel, TeeEdit, StdCtrls, TeeLisB,
  TeeSeriesTextEd, TeeOpenGL, ExtCtrls, TeeProcs, TeeDraw3D, TeCanvas,
  TeePenDlg, TeEngine, TeeDBEdit, TeeDBCrossTab, DB, TeeData, SUIButton,
  SUIForm, TeeInspector, Chart, Series, TeeSmith, Buttons, TeeComma;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    TeeCommander1: TTeeCommander;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    Draw3D1: TDraw3D;
    ButtonColor1: TButtonColor;
    TeeOpenGL1: TTeeOpenGL;

    procedure FormCreate(Sender: TObject);
    procedure ButtonColor1Click(Sender: TObject);
    procedure Draw3D1Paint(Sender: TObject; const ARect: TRect);
    procedure CheckBox1Click(Sender: TObject);
    procedure CheckBox2Click(Sender: TObject);
    procedure CheckBox3Click(Sender: TObject);
    procedure CheckBox4Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
rc:TRect;
begin
rc.Left := 20;
rc.Top  := 15;
rc.Right := 200;
rc.Bottom := 150;

//Draw3D1.BackImage.LoadFromFile('Draw3DBackGround.BMP');

{
Series1.FillSampleValues(7);
Series2.FillSampleValues(7);
Series3.FillSampleValues(7);
Series4.FillSampleValues(7);
Series5.FillSampleValues(7);
Series6.FillSampleValues(7);
Series7.FillSampleValues(7);
Series8.FillSampleValues(7);
}
end;




procedure TForm1.ButtonColor1Click(Sender: TObject);
var
str0:string;
begin
str0 :=   'Draw3D1.Width = '+IntToStr(Draw3D1.Width)+#10#13+
          'Draw3D1.Width3D = '+IntToStr(Draw3D1.Width3D)+#10#13+
          'Draw3D1.Height = '+IntToStr(Draw3D1.Height)+#10#13+
          'Draw3D1.Height3D = '+IntToStr(Draw3D1.Height3D)+#10#13+
          'Draw3D1.ChartXCenter = '+IntToStr(Draw3D1.ChartXCenter)+#10#13+
          'Draw3D1.ChartYCenter = '+IntToStr(Draw3D1.ChartYCenter); //+#10#13+
ShowMessage(str0);
end;

procedure TForm1.Draw3D1Paint(Sender: TObject; const ARect: TRect);
var
MyBit:TBitmap;
begin
with Draw3D1 do
begin
MyBit := tbITMAP.Create;
MyBit.LoadFromFile('Background.bmp');
Canvas.Draw(7,7,Mybit);
Canvas.Pen.Style := psDashDot	;
if CheckBox3.Checked then
begin
  Canvas.MoveTo3D(251,10,0);
  Canvas.LineTo3D(251,273,0);           //纵坐标
  Canvas.MoveTo3D(10,141,-100);
  Canvas.LineTo3D(493,141,100);         //横坐标 （左下，右上）
  Canvas.MoveTo3D(10,141,100);
  Canvas.LineTo3D(493,141,-100);        //横坐标（左上、右下）
end;
Canvas.Pen.Color := clGreen;
Canvas.Brush.Color := RGB(125,128,128);
Canvas.Pie3D(100,200,60,15,30,100,15,90,CheckBox1.Checked,true);    //园饼
Canvas.Brush.Color := RGB(125,120,128);
Canvas.Pyramid(true,300,50,400,100,0,50,CheckBox1.Checked);         //锥
Canvas.Brush.Color := RGB(255,0,0);
Canvas.Sphere(Draw3D1.ChartXCenter+150,Draw3D1.ChartYCenter+80,0,50);  //球体
Canvas.Cube(250,270,40,90,0,10,CheckBox1.Checked);                  //立方体
Canvas.Cube(300,320,40,90,0,10,CheckBox1.Checked);
Canvas.Cube(260,280,100,150,0,10,CheckBox1.Checked);
Canvas.Cube(310,330,100,150,0,10,CheckBox1.Checked);
Canvas.Brush.Color := RGB(0,128,0);
Canvas.Cylinder(true,150,80,190,160,10,70,CheckBox1.Checked);     //园柱体
Canvas.Font.Color := clRed;
Canvas.Font.Name := '仿宋_GB2312';
Canvas.BackMode :=  cbmTransparent;
Canvas.Font.Size := 16;
//Canvas.TextOut3D(10,250,45,'这是一个Draw3D组件功能演示') ;
//Canvas.RotateLabel3D(20,200,10,'旋转文本',90.0);
end;
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin  //阴影
Draw3D1.Refresh;
end;

procedure TForm1.CheckBox2Click(Sender: TObject);
begin    //背景渐进
if  CheckBox2.Checked then
   Draw3D1.Gradient.Visible := true
   else
   Draw3D1.Gradient.Visible := false;
end;

procedure TForm1.CheckBox3Click(Sender: TObject);
begin    //坐标
  Draw3D1.OnPaint(Sender,Draw3D1.ClientRect);
end;

procedure TForm1.CheckBox4Click(Sender: TObject);
begin
  TeeOpenGL1.Active  := CheckBox4.Checked;
end;

end.
