小
小学生_hjz
Unregistered / Unconfirmed
GUEST, unregistred user!
unit makemap1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Buttons, StdCtrls, ComCtrls, Menus, ToolWin;
type
TForm1 = class(TForm)
ScrollBox1: TScrollBox;
bild: TPaintBox;
opend: TOpenDialog;
Bar1: TStatusBar;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
Memo1: TMemo;
ToolBar1: TToolBar;
MainMenu1: TMainMenu;
fire1: TMenuItem;
open1: TMenuItem;
N1: TMenuItem;
Quit1: TMenuItem;
GroupBox1: TGroupBox;
ComboBox1: TComboBox;
N2: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure bildPaint(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure bildMouseMove(Sender: TObject;
Shift: TShiftState;
X,
Y: Integer);
procedure bildMouseDown(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
procedure bildMouseUp(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
procedure bildDblClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
procedure showmap2Click(Sender: TObject);
procedure showmap1Click(Sender: TObject);
procedure open1Click(Sender: TObject);
private
{ Private-Deklarationen }
function getzoom : integer;
procedure updatebild;
procedure getimgs;
procedure gettbmp;
procedure settbmp;
procedure addmap(x,y:integer);
function gv (a,x:integer):string;
procedure drawmap(s:string);
function gc (var s : string):integer;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
myimg : array [-1..4] of tbitmap;
map : tstrings;
points : tstrings;
mode : integer = 1;
ismode : boolean = false;
oldx,oldy : integer;
pts : array [0..500] of tpoint;
ptix : integer = 0;
allownext : boolean = true;
allowchange : boolean = true;
canchange : boolean = true;
const zoom : array [-1..3] of byte = (1,1,2,4,8);
implementation
{$R *.DFM}
function tform1.gc (var s : string):integer;
var t : integer;
begin
1: result := maxint;
-------------------------------
if length(s) < 2 then
exit;
if s[1] = ',' then
begin
delete(s,1,1);
t := pos(',',s);
if t = 0 then
t := maxint-1;
result := strtointdef(copy(s,1,t-1),maxint)*getzoom;
s := copy(s,t,maxint);
end;
end;
procedure tform1.drawmap(s:string);
var ch : char;
a,b,c,d : integer;
2: tmt : array [0..500] of tpoint;
-------------------------------------
begin
ch := s[1];
delete(s,1,1);
3: with bild.canvasdo
begin
------------------------------------
4: //pen.mode := pmblack;
---------------------------------------
if ch <> 'p' then
begin
a := gc(s);
b := gc(s);
c := gc(s);
d := gc(s);
end;
case ch of
5 : 'c' : ellipse(a,b,c,(c-a)+b);
------------------------------------------------
'p' : begin
a := 0;
b := gc(s);
while b < maxint-1do
begin
tmt[a].x := b;
tmt[a].y := gc(s);
inc(a);
b:=gc(s);
end;
6: polygon(slice(tmt,a-1));
-------------------------------------------------------
end;
7: 'r' : rectangle(a,b,c,d);
--------------------------------------------
end;
end;
end;
1.处的result与 maxint前面没有说明不知道是什么.
2.处的tpoint不知道是什么类型.
3处的bild.canvas不知道为什么这么用,换成bild可以么.
4.处的语句是什么意思呀
5.6.7处的字符不是程序中的函数不知道是什么.
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Buttons, StdCtrls, ComCtrls, Menus, ToolWin;
type
TForm1 = class(TForm)
ScrollBox1: TScrollBox;
bild: TPaintBox;
opend: TOpenDialog;
Bar1: TStatusBar;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
Memo1: TMemo;
ToolBar1: TToolBar;
MainMenu1: TMainMenu;
fire1: TMenuItem;
open1: TMenuItem;
N1: TMenuItem;
Quit1: TMenuItem;
GroupBox1: TGroupBox;
ComboBox1: TComboBox;
N2: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure bildPaint(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure bildMouseMove(Sender: TObject;
Shift: TShiftState;
X,
Y: Integer);
procedure bildMouseDown(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
procedure bildMouseUp(Sender: TObject;
Button: TMouseButton;
Shift: TShiftState;
X, Y: Integer);
procedure bildDblClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
procedure showmap2Click(Sender: TObject);
procedure showmap1Click(Sender: TObject);
procedure open1Click(Sender: TObject);
private
{ Private-Deklarationen }
function getzoom : integer;
procedure updatebild;
procedure getimgs;
procedure gettbmp;
procedure settbmp;
procedure addmap(x,y:integer);
function gv (a,x:integer):string;
procedure drawmap(s:string);
function gc (var s : string):integer;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
myimg : array [-1..4] of tbitmap;
map : tstrings;
points : tstrings;
mode : integer = 1;
ismode : boolean = false;
oldx,oldy : integer;
pts : array [0..500] of tpoint;
ptix : integer = 0;
allownext : boolean = true;
allowchange : boolean = true;
canchange : boolean = true;
const zoom : array [-1..3] of byte = (1,1,2,4,8);
implementation
{$R *.DFM}
function tform1.gc (var s : string):integer;
var t : integer;
begin
1: result := maxint;
-------------------------------
if length(s) < 2 then
exit;
if s[1] = ',' then
begin
delete(s,1,1);
t := pos(',',s);
if t = 0 then
t := maxint-1;
result := strtointdef(copy(s,1,t-1),maxint)*getzoom;
s := copy(s,t,maxint);
end;
end;
procedure tform1.drawmap(s:string);
var ch : char;
a,b,c,d : integer;
2: tmt : array [0..500] of tpoint;
-------------------------------------
begin
ch := s[1];
delete(s,1,1);
3: with bild.canvasdo
begin
------------------------------------
4: //pen.mode := pmblack;
---------------------------------------
if ch <> 'p' then
begin
a := gc(s);
b := gc(s);
c := gc(s);
d := gc(s);
end;
case ch of
5 : 'c' : ellipse(a,b,c,(c-a)+b);
------------------------------------------------
'p' : begin
a := 0;
b := gc(s);
while b < maxint-1do
begin
tmt[a].x := b;
tmt[a].y := gc(s);
inc(a);
b:=gc(s);
end;
6: polygon(slice(tmt,a-1));
-------------------------------------------------------
end;
7: 'r' : rectangle(a,b,c,d);
--------------------------------------------
end;
end;
end;
1.处的result与 maxint前面没有说明不知道是什么.
2.处的tpoint不知道是什么类型.
3处的bild.canvas不知道为什么这么用,换成bild可以么.
4.处的语句是什么意思呀
5.6.7处的字符不是程序中的函数不知道是什么.