报错EInvalidgraphic类是什么意思?(30分)

  • 主题发起人 主题发起人 lfkm
  • 开始时间 开始时间
L

lfkm

Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
//form2.Show;
randomize;
i:=random(11);
case i of
0:image1.Picture.LoadFromFile('暗像.bmp');
1:image1.Picture.LoadFromFile('女像.bmp');
2:image1.Picture.LoadFromFile('女像1.bmp');
3:image1.Picture.LoadFromFile('手像.bmp');
4:image1.Picture.LoadFromFile('鱼跃.bmp');
5:image1.Picture.LoadFromFile('黄沙.bmp');
6:image1.Picture.LoadFromFile('奔马.bmp');
7:image1.Picture.LoadFromFile('女像.bmp');
8:image1.Picture.LoadFromFile('多马奔驰.bmp');
9:image1.Picture.LoadFromFile('天马飞腾.bmp');
10:image1.Picture.LoadFromFile('冰箱.bmp');
end;
end;

end.
那个高手能帮帮忙看出错在哪?我运行是出错的,说:bitmap image is not valid. 这是什么意思?按说我的代码应该没错呀.
 
后退
顶部