I am writing a program that wil have about 1000 bitmaps throughout it. What is the best way to display the bitmap on each screen without swelling the size of my executable?
Cheers
Mike Ross
Hi.
you can create those images at runtime and load'em from the needed files:
public
bmp:timage
{ Public declarations }
....
procedure TForm1.Button1Click(Sender: TObject);
begin
bmp:=timage.Create(form1);//or another form
bmp.Parent:=form1;// ----------- // --------
bmp.AutoSize:=true;//here when it created you can also modify //other parameters like bmp.left and bmp.width
bmp.Picture.LoadFromFile('d:\pictures\bitmap.bmp');//or another //bitmap
end;
and dont forget to call bmp.free in Form1.onclose.
You can also include them in a Resource file which I think is the best way since no one can exchange your bitmaps....Otherwise if you load the bitmaps from a file someone can change the bitmap and just change the name to be as the previous....
Regards,
Viktor Ivanov
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
you can create those images at runtime and load'em from the needed files:
public
bmp:timage
{ Public declarations }
....
procedure TForm1.Button1Click(Sender
begin
bmp:=timage.Create(form1);
bmp.Parent:=form1;// ----------- // --------
bmp.AutoSize:=true;//here when it created you can also modify //other parameters like bmp.left and bmp.width
bmp.Picture.LoadFromFile('
end;
and dont forget to call bmp.free in Form1.onclose.