Link to home
Start Free TrialLog in
Avatar of mtieland
mtieland

asked on

howto compile a bitmap in your program?

How can I get a bitmap into a nonvisual component. I want to compile a bitmap in the component so that it is a static graphic wich I can use...

Anyone, please,

Martijn
Avatar of Motaz
Motaz

The best way I think is to drop an image component, load a bitmap on it and set it's visible property to false, then you can use it later at run time, for example

//Store the pitmap in MyHiddenImage TImage component

Image1.Picture.Bitmap.Assign(MyHiddenImage.Picture.Bitmap);

Motaz

www.geocities.com/motaz1
If you do so, the bitmap will be stored in your exe file.
Avatar of mtieland

ASKER

The problem is I am making a Desendant from TComponent and need to store the image in the class... I want to make a Active X Control eventually...

I see, then you have to use another technique which I'm not sure about, may be a resource file, streams and so on, let the experts answer you.

Motaz
another good solution would be to load the image from a webserver, if anyone has an easy to use component to do just that. That would solve my problem too..
you can put bitmap into a res file
and use tresourestream to load it in your program .And if you want make a activex control,may be you should make your control inherited from twincontrol

good luck

hubdog
can you explain some more about that resource file thing...
I have a good example of how to make and use a resource file on my website...
www.drdelphi.com. Look under sample codes and then the snippet is An AVI resource example.... or go directly to:

http://www.drdelphi.com/delphi/right/tips/avires.htm



Good luck!!
ASKER CERTIFIED SOLUTION
Avatar of hubdog
hubdog

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx a lot