这是我的整个代码:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Images: array[0..29,0..39] of TImage; //array
implementation
{$R *.dfm}
//form create
procedure TForm1.FormCreate(Sender: TObject);
var xx,yy: Integer; //local variables
begin
for xx:=0 to 29 do
for yy:=0 to 39 do
begin
Images[xx,yy]:=Timage.Create(Form1);
Images[xx,yy].Canvas.Rectangle(0,0,17,17);
Images[xx,yy].Left:=xx*16;
Images[xx,yy].Top:=yy*16;
end;
end;
end.
而且我总是收到错误消息:“ Project Project1.exe 引发了异常类 EClassNotFound,并带有消息“TImage not found”。进程已停止。使用 step 或 run 继续“
我在互联网上尝试过其他代码,例如:
Delphi:TImage.Create 导致访问冲突
http://www.delphi-central.com/tutorials/memory_game_2.aspx
没有什么帮助!为什么会这样?
谢谢你。