• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Place a bitmap on the form

How can you place a bitmap on the form, whit out using an Image component but in cod form?

Thanks.
0
kingInKvong
Asked:
kingInKvong
1 Solution
 
ILECommented:
Working solution

use a canvas

procedure TForm1.Button1Click(Sender: TObject);
var bitmap1:tbitmap;
begin
  bitmap1:=tbitmap.create;
  BitMap1.LoadFromFile('f:\brisi\arrow1d.bmp');
  canvas.draw(50,50,bitmap1);
  bitmap1.free;
end;




the best way for do that is to do in the onpaint event
:)


so  :))

0
 
LukA_YJKCommented:
ILE's solution is all-right. Maybe you better save your bitmap in a resource. Then use it by ($R} and LoadBitmap...
Dobra rana, ILE, and welcome ;)
0
 
andrewjbCommented:
You'll need to do that in the form's OnPaint event or it'll get erased when you move things about...
0
 
kingInKvongAuthor Commented:
Thank you for the help.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now