Add Papers Marked0
Paper checked off!

Marked works

Viewed0

Viewed works

Shopping Cart0
Paper added to shopping cart!

Shopping Cart

Register Now

internet library
Atlants.lv library
FAQ
4,99 € Add to cart
Add to Wish List
Want cheaper?
ID number:830007
 
Author:
Evaluation:
Published: 27.05.2009.
Language: Latvian
Level: College/University
Literature: n/a
References: Not used
Extract

Programmas kods
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 = class(TForm)
butDraw: TButton;
ex1: TEdit;
ey1: TEdit;
ex2: TEdit;
ey2: TEdit;
Label_x: TLabel;
Label_y: TLabel;
tableGrid: TStringGrid;
procedure butDrawClick(Sender: TObject);
procedure swapCoor(var1, var2 : PInteger);
procedure Bresenham(x1, x2, y1, y2 : integer);
procedure writeToGrid(n, Pn, Xn, Yn : integer);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.swapCoor(var1, var2 : PInteger);
var temp : integer;
begin
temp := var1^;
var1^:=var2^;
var2^:=temp;
end;
procedure TForm1.Bresenham(x1, x2, y1, y2 : integer);
var dx, dy, Pn, Xn, Yn, x0, y0, ystep, n : integer;
steep : boolean;
begin
x0:=Round(Form1.Width/2)-100;
y0:=Round(Form1.Height/2)+20;
n:=0;
steep:=abs(x2-x1) < abs(y2-y1);
if (steep=True) then
begin
swapCoor(@x1, @y1);
swapCoor(@x2, @y2);
end;
if (x1 > x2) then
begin
swapCoor(@x1, @x2);
swapCoor(@y1, @y2);
end;
dx:=x2-x1;
dy:=y2-y1;

Author's comment
Work pack:
GREAT DEAL buying in a pack your savings −8,48 €
Work pack Nr. 1130208
Load more similar papers

Atlants

Choose Authorization Method

Email & Password

Email & Password

Wrong e-mail adress or password!
Log In

Forgot your password?

Draugiem.pase
Facebook

Not registered yet?

Register and redeem free papers!

To receive free papers from Atlants.com it is necessary to register. It's quick and will only take a few seconds.

If you have already registered, simply to access the free content.

Cancel Register