Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query regarding bitmaps in components

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
I'm working on a project where I could use the ability to put up and down arrows on a couple of the buttons on one of the forms. I noticed there's a bitmap attribute for the button component, and it shows the image during compile time, but the buttons are blank during runtime. (No caption - the image was supposed to take its place.) Is there some special way I need to import the images into the delphi project, or is the bitmap component not used for that kind of purpose, or am I simply doing something wrong here?
 
Have you looked at TSpinButton on the Samples tab of the component palette? (Unit ..\Source\Samples\Spin.pas)

Roo
Delphi Rules!
 

For my buttons with images, (on a form other than the main by the way) I couldn't get an image from a Timagelist to work either. I think I tried using the imagelist on main form and putting one on the form in question, though not 100% on that now.
So what I did to enable me to carry on was just save a bitmap in the same folder as my project. Then for the Glyph property of my TBitBtn I loaded the bitmap I placed in the project folder.
That worked for me.

When I'm all done with the project (which also has some larger map bitmaps) my plan is to include all the bitmaps into the compiled project using a resource file, so you don't need to have the image files supplied separately.

Hope that may help, if only till you sort a more elegant way.



Steve (Delphi 2007 & XP)
 
What bit depth are the files? I think some versions of Delphi cannot handle more than 16-bit colour depth.
 
Problem, if not solved, alleviated.

I was attempting to place the images onto regular button components, which for some reason would not hold them. Putting BitButtons in instead allowed the images to remain. Although I'd still like to know why the buttons had an image attribute (may not be called image - can't recall and not at that box right now) if it doesn't seem to want to take images.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top