tags:

views:

53

answers:

1

D7: I created an edit box component which only accepts integers. I want to create a buttonbar icon for it based on TEdit.

TEDit shows "ABC" and a cursor on a white background. I copied and, pixel by pixel, changed ABC to 123. However, while TEdit shows a white background, mine shows gray.

The pixels are definitely white but show up the same colour as the background. Can I have set white=transparent somehow?

Nope, I filled the white with lime green & saved everything but it still shows up gray on the button bar.

Any idea what I am doing wrong?

(and any hints on the best way to create images? use built in tool or external? or any great web sites with lots of free buttons?

+6  A: 

if you are trying of add an image for your component, you can use any application you want to generate the image, just you must follow the next guidelines.

  • the format must be a BMP of 16 or 256 colors.
  • must be of 24x24 pixels
  • The lower-left pixel of the image defines the transparent color, so every occurrence of that color is automatically replaced with the color of the toolbar components background. for default delphi uses the clFuchsia (clFuchsia: TColor = $FF00FF) color for this.

see these samples images (zoom x 8)

this image must appear filled (check the clFuchsia lower-left pixel) in the toolbar pallete (The clFuchsia pixel is not necessary, is only to show the location).

alt text

In this case the image will have a transparent background

alt text

try out these links for glyph images

  • Delphi-Box's Glyph-Collection
  • from the 2005 version of Delphi, is include an free collecion of images , you can find on this path C:\Program Files\Common Files\CodeGear Shared\Images\GlyFX
  • Glyfx Site (Excellents icons, but you must paid)
RRUZ
+1 and the answer "The lower-left pixel of the image defines the transparent color" - that's my problem! Thanks
Mawg
aargh! the bottom left thing doesn't seem to be working. I used the built in image editor and also the command line resource compiler :-(
Mawg