S
samz
Unregistered / Unconfirmed
GUEST, unregistred user!
我将一个很小的bmp文件(文件名bk.bmp)编译进一个名叫background.RES的资源文件中,并使用{$R background.RES}编译指令包含在我的应用程序中,但不知道为何执行时总是提示‘resource BG1 not found'(0分)<br />background.rc 文件如下:
BG1 bmp "bk.bmp"
我的程序如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM }
{$R background.RES}
procedure TForm1.Button1Click(Sender: TObject);
var
Tmp_bk:TBitmap;
begin
Tmp_bk:=TBitmap.Create;
Tmp_bk.LoadFromResourceName(Hinstance, 'BG1')
end;
end.
没分了!
先多谢各位大富翁的指教!
BG1 bmp "bk.bmp"
我的程序如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM }
{$R background.RES}
procedure TForm1.Button1Click(Sender: TObject);
var
Tmp_bk:TBitmap;
begin
Tmp_bk:=TBitmap.Create;
Tmp_bk.LoadFromResourceName(Hinstance, 'BG1')
end;
end.
没分了!
先多谢各位大富翁的指教!