Results 1 to 9 of 9

Thread: Component Icon

  1. #1

    Component Icon

    I've been creating my own set of components for a few things that I like to use throughout many projects and I would like to add Icon's to the component that's displayed in the delphi ide. Im not sure how this is done. Anyone can walk thru it real fast?
    I have a 2005 CRF 250 so <^>(>&lt<^>
    <br />http://www.gtrpg.com/

  2. #2

    Re: Component Icon

    You need to make a DCR file with the icon in it.

    Create a Bitmap first. The size shouldn't exceed 24x24 or it will get clipped. Any color depth is fine (although alpha transparency isn't supported).

    Now you need to create a resource file. Either use the Image Editor that comes with Delphi or use the borland resource compiler (BRCC32.exe, can be found in the \bin folder) and a resource script. Make sure you name the bitmap resource identical to the class name you're creating the icon for. So if your class is called TMyButton the Bitmap resource should be called TMYBUTTON. I'm pretty sure the all-uppercase is required.

    I recommend using a resource script since that will allow you to create better looking icons (the image editor is restricted to 256 colors and the windows default palette).

    Name the resource file the same as your .PAS file and give it a .DCR extension. That should do the trick.

    Note that the pixel in the lower left corner of your image will be used to determine the color for transparency.
    Ask me about the xcess game development kit

  3. #3

    Component Icon

    Not working
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

  4. #4

    Component Icon

    {R *.dcr}

    you need this to be in the main file jsut right after implementation
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  5. #5

    Component Icon

    Quote Originally Posted by xGTx
    Not working
    ungrateful bastard
    Ask me about the xcess game development kit

  6. #6

    Component Icon

    :cry: I didn't mean to be rude if i was Harry
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

  7. #7

    Component Icon

    Quote Originally Posted by xGTx
    :cry: I didn't mean to be rude if i was Harry
    i was kidding of course.
    Ask me about the xcess game development kit

  8. #8

    Component Icon

    You scared me. :shock:
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

  9. #9

    Component Icon

    Sweet... Got it working, thanks guys
    I have a 2005 CRF 250 so &lt;^&gt;(&gt;&lt&lt;^&gt;
    <br />http://www.gtrpg.com/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •