Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Component icon on palette - Weird looking bitmap

28 views
Skip to first unread message

Magnus Flysjö

unread,
Apr 10, 2008, 8:28:23 PM4/10/08
to
I was on a system yesterday where only Delphi2007 was installed and needed
to create some component icons for the component palette.

Since the old Image Editor wasn't installed I figured I could just create my
own rc file with some bitmap lines, compile it using the resource compiler
and rename the .res file to .dcr:

(example of the .rc file)
--
TStatusLabel BITMAP StatusLabelIcon.bmp
TRelayList BITMAP RelayListIcon.bmp
--

However, after registration in the IDE, the component icon looks corrupted
and weird on the palette. (It looks mirrored and has some pixel corruption,
although I can see that it's my image)

My questions is:
- How does people create the DCR files nowadays whithout the old Image
Editor, is my way described above the suggested way? (I cant find anything
useful in the help)
- Whats the guidelines for the actual BMP file regarding color depth, RLE
compressing etc? (I know is should be 24x24 in size)

Can someone share some light over this?

Regards
Magnus Flysjö


Remy Lebeau (TeamB)

unread,
Apr 11, 2008, 12:33:50 AM4/11/08
to

"Magnus Flysjö" <mag...@flysjo.com> wrote in message
news:47fe...@newsgroups.borland.com...

> TStatusLabel BITMAP StatusLabelIcon.bmp
> TRelayList BITMAP RelayListIcon.bmp

Palette images need to be named in all uppercase.

> However, after registration in the IDE, the component
> icon looks corrupted and weird on the palette. (It looks
> mirrored and has some pixel corruption, although I can
> see that it's my image)

The color depth in the bitmaps is probably too high.


Gambit


Magnus Flysjö

unread,
Apr 11, 2008, 4:11:34 AM4/11/08
to
>> TStatusLabel BITMAP StatusLabelIcon.bmp
>> TRelayList BITMAP RelayListIcon.bmp
>
> Palette images need to be named in all uppercase.
>

It doesn't seem to be a "must" in Delphi2007.
The correct bitmap is loaded for each component using a mixed case string,
so this must be an old requirement that isnt a must anymore. But sure, for
backward compatibility the name should always be in uppercase.

>> However, after registration in the IDE, the component
>> icon looks corrupted and weird on the palette. (It looks
>> mirrored and has some pixel corruption, although I can
>> see that it's my image)
>
> The color depth in the bitmaps is probably too high.
>

Well, I am using 8bit (256 colors) at the moment. It would be great if stuff
like this was in the RAD Studio help, but I havent been able to find
anything about any rules regarding the palette icon.

/Magnus


Remy Lebeau (TeamB)

unread,
Apr 11, 2008, 5:11:46 AM4/11/08
to

"Magnus Flysjö" <mag...@flysjo.com> wrote in message
news:47ff...@newsgroups.borland.com...

> Well, I am using 8bit (256 colors) at the moment.

You should be ok with that. Historically, problems with the tool palette
display getting messed up was a result of incompatibilities between Delphi
and the OS's video driver.


Gambit


C-H

unread,
Apr 11, 2008, 2:08:24 PM4/11/08
to

"Magnus Flysjö" <mag...@flysjo.com> wrote:
>However, after registration in the IDE, the component icon looks corrupted
>and weird on the palette. (It looks mirrored and has some pixel corruption,
>although I can see that it's my image)
>
>My questions is:
>- How does people create the DCR files nowadays whithout the old Image
>Editor, is my way described above the suggested way? (I cant find anything
>useful in the help)
>- Whats the guidelines for the actual BMP file regarding color depth, RLE
>compressing etc? (I know is should be 24x24 in size)
>
>Can someone share some light over this?
>
>Regards
>Magnus Flysjö

The problem you're seeing has to do with the fact that you can choose
what button/icon size to display in your tool palette. If you right click
on a component and select "properties" you're presented with three choices:

Small (16x16)
Medium (24x24)
Large (32x32)

That's what I have in my trusted D2005 anyway.

If your icon is 24x24 it will look Ok in Medium and perhaps distorted in Small.

I also found this reply about how you can supply component icons of different
sizes:
-----------------------
On 10/01/2006 18:33:04, Atmapuri wrote:

> I know its possible to specifiy several icons
> of different sizes for a single components in D2006 IDE.
> But how?

Append "16" or "32" to the name of the component bitmap for 16x16 and
32x32 bitmaps, respectively. The default bitmap size is 24x24.

So, for a component called TMyComponent, use the following bitmap
names:
TMYCOMPONENT - 24x24
TMYCOMPONENT16 - 16x16
TMYCOMPONENT32 - 32x32

--
Yorai Aminov (TeamB)
-----------------------
I haven't been able to make it work in D2005 though.

You can also find out what the VCL icon bitmaps look like if you open the
dclstd...bpl file in the XN Resource Editor. The file is in the bin folder.

/C-H

C-H

unread,
Apr 11, 2008, 2:16:46 PM4/11/08
to

"C-H" <nos...@nospam.com> wrote:

>You can also find out what the VCL icon bitmaps look like if you open the
>dclstd...bpl file in the XN Resource Editor. The file is in the bin folder.
>
>/C-H

Forgot to say I can recommend the free XN Resource Editor for
making component icons and other things:

http://www.wilsonc.demon.co.uk/delphi.htm

/C-H

Remy Lebeau (TeamB)

unread,
Apr 11, 2008, 3:22:17 PM4/11/08
to

"C-H" <nos...@nospam.com> wrote in message
news:47ffa918$1...@newsgroups.borland.com...

> I also found this reply about how you can supply component icons
> of different sizes:

That's good to know. I never heard of that before.


Gambit


Magnus Flysjö

unread,
Apr 11, 2008, 4:04:24 PM4/11/08
to
> Append "16" or "32" to the name of the component bitmap for 16x16 and
> 32x32 bitmaps, respectively. The default bitmap size is 24x24.
>
> So, for a component called TMyComponent, use the following bitmap
> names:
> TMYCOMPONENT - 24x24
> TMYCOMPONENT16 - 16x16
> TMYCOMPONENT32 - 32x32
>


Thanks a lot for the information!
I had the palette icons set to small 16x16 and when I set it to medium the
icon was ok.

/Magnus


Rudy Velthuis [TeamB]

unread,
Apr 11, 2008, 4:24:04 PM4/11/08
to
C-H wrote:

> So, for a component called TMyComponent, use the following bitmap
> names:
> TMYCOMPONENT - 24x24
> TMYCOMPONENT16 - 16x16
> TMYCOMPONENT32 - 32x32

Wow, I didn't know that yet. Thanks!

--
Rudy Velthuis [TeamB] http://www.teamb.com

"When ideas fail, words come in very handy." -- Goethe (1749-1832)

JED

unread,
Apr 23, 2008, 11:18:05 PM4/23/08
to
Rudy Velthuis [TeamB] wrote:

> C-H wrote:
>
> > So, for a component called TMyComponent, use the following bitmap
> > names:
> > TMYCOMPONENT - 24x24
> > TMYCOMPONENT16 - 16x16
> > TMYCOMPONENT32 - 32x32
>
> Wow, I didn't know that yet. Thanks!

http://jed-software.com/blog/?p=74

--
JSDialog Pack - TaskDialog for other operating systems:
http://www.jed-software.com/jsd.htm
Visual Forms IDE Add In: http://www.jed-software.com/vf.htm

Blog: http://jedqc.blogspot.com

0 new messages