unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, NumEdit, ExtCtrls;
type
TForm1 = class(TForm)
PaintBox1: TPaintBox;
IntEdit1: TIntEdit;
IntEdit2: TIntEdit;
IntEdit3: TIntEdit;
IntEdit4: TIntEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Button1: TButton;
IntEdit5: TIntEdit;
IntEdit6: TIntEdit;
IntEdit7: TIntEdit;
IntEdit8: TIntEdit;
Label5: TLabel;
Label6: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var xmin, xmax, ymin, ymax, deltax, deltay, einheitx, einheity: integer;
begin
xmin:=IntEdit1.Value;
xmax:=IntEdit2.Value;
ymin:=IntEdit3.Value;
xmax:=IntEdit4.Value;
deltax:=xmax-xmin;
deltay:=ymax-ymin;
einheitx:=PaintBox1.Width div deltax;
einheity:=PaintBox1.Height div deltay;
IntEdit5.Value:=deltax;
IntEdit6.Value:=einheitx;
IntEdit7.Value:=deltay;
IntEdit8.Value:=einheity;
PaintBox1.Canvas.MoveTo(0,round(einheity*ymax));
PaintBox1.Canvas.LineTo(Paintbox1.Width,round(einheity*ymax));
PaintBox1.Canvas.MoveTo(round(einheitx*xmax),0);
PaintBox1.Canvas.LineTo(round(einheitx*xmax),Paintbox1.Height);
end;
end.