|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Tue Oct 19, 2010 4:16 am
Button and Images |
Hey all,
I have created a few buttons which I've never used before but thought it would be fun to play around with. Is there a way to use your own image on the button instead of the bitmap images that is able to be selected in image Name field? I would like to have a button with a png image that lays on top of it. |
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian) |
|
|
|
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Tue Oct 19, 2010 4:47 am |
Make sure the image you want to use is in .bmp format. Then in the options tab of the button copy the file path for the .bmp image into the Image Name box. You can also use the %btnimage function from the command line to assign the image you wish to use.
|
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34 |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Oct 19, 2010 4:55 am |
Yes you can. You can put the full path and filename of the file (it must be BMP) in the image name field. For example:
Code: |
C:\$user\Projects\Java\Go\Go_b.bmp |
|
|
_________________ Asati di tempari! |
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Tue Oct 19, 2010 2:56 pm |
I wish it could be something other than a bmp. I would rather use png files.
|
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Oct 19, 2010 5:14 pm |
It's a limitation of the 3rd party button component for Delphi that CMUD uses. It's actually possible that some other formats will work, but you'll just need to experiment and try it. But since PNG support requires supporting alpha transparency, it might not look right even if it loads. Adding full support for additional image formats is on the to-do list for the future.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Oct 19, 2010 5:24 pm |
Well I tried PNG and JPG and no luck there. I didn't try gif though, so that might be something. However the specific error message says it's not a valid bitmap, so I'm not sure any other file type will work.
|
|
_________________ Asati di tempari! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Oct 19, 2010 5:37 pm |
Yep, that's what I was afraid of. That means they are not calling the generic Delphi image loading routines (which support JPG and PNG) but are loading the BMP image themselves. I doubt GIF will work either then. Oh well, it was worth testing.
|
|
|
|
darmir Sorcerer
Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Tue Oct 19, 2010 6:01 pm |
Thanks for checking it out.. I guess I'll just try to create my images in bmp format.
|
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian) |
|
|
|
|
|