Announcement

Collapse
No announcement yet.

Howdya make a Desktop icon for Myapp.exe file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Howdya make a Desktop icon for Myapp.exe file

    I have my cool little app and it has this boring looking square icon that looks like an empty window.

    How do i make a nifty icon like the "My Computer" icon?

    I can do the artwork in Photoshop, but does the background have to be white where you want the desktop to show through?

    Then how do you included it as a resource?

    How does the compiler and windows know to use it?

    Regards
    Mike

    ------------------
    Kind Regards
    Mike

  • #2
    Originally posted by Mike Trader:
    I have my cool little app and it has this boring looking square icon that looks like an empty window.

    How do i make a nifty icon like the "My Computer" icon?

    I can do the artwork in Photoshop, but does the background have to be white where you want the desktop to show through?

    Then how do you included it as a resource?

    How does the compiler and windows know to use it?

    The background needs to be "transparent" rather than "white".

    1.Once you have created your icon (called say MyIcon.ICO), create a plain text file called Resource.rc with a single line:
    PROGRAM ICON MYICON.ICO

    2. From the Commandline run "RC RESOURCE.RC" to compile the resource file to RESOURCE.RES

    3. From the commandline run "PBRES RESOURCE.RES" to create the PB compatible RESOURCE.PBR

    (Note RC.EXE and PBRES.EXE are in your PowerBasic BIN directory)

    4. At the start of your PB/DLL code include the line:

    #RESOURCE "RESOURCE.PBR"


    ------------------
    Check out my free software at http://www.lexacorp.com.pg(all written in PB/DLL)



    [This message has been edited by Stuart McLachlan (edited June 26, 2001).]

    Comment


    • #3
      > How do i make a nifty icon like the "My Computer" icon?

      You need an Icon Editor. I like and use a shareware program called MicroAngelo from http://www.impactsoftware.com/ . You can draw your own, or MicroAngelo can "extract" icons from existing EXE and DLL files. There are literally thousands of icons available for download from the 'net, although many of the files that are labeled "icons" are really GIF files, which are not usable for programs. (Unless you convert them to ICO files.)

      > I can do the artwork in Photoshop,

      Not unless PhotoShop can save ICO files.

      > but does the background have to be white
      > where you want the desktop to show through?

      No, a special ugly-greenish color has been reserved for "transparent".

      > Then how do you included it as a resource?

      You create a resource (RC) file that contains an ICON line. I use the Visual Studio resource editor so I don't know the syntax off the top of my head. Search the BBS for DISCARDABLE and you will probably find several examples.

      > How does the compiler (...) know to use it?

      You convert the RC file to a RES file using RC.EXE, then use PBRES to convert the RES file into a PBR file, then use $RESOURCE to link the PBR to your EXE or DLL when you compile it.

      > How does (...) windows know to use it?

      Windows uses the first icon in your EXE or DLL. If you use numeric IDs (the most efficient method) then the icon with the lowest number is used. If you use text IDs, the icon that comes first, alphabetically, is used.

      There's a lot to it, really. Lots of details...

      There are several different sizes of icons that Windows uses for the title bar icon, the task bar, the Alt-Tab menu, shortcuts, etc. For best results you should usually create a Large (32x32, 16 colors) and a Small (16x16, 16 colors) icon, both in the same ICO file, and Windows will use the best choice for each element. Certain icon colors don't look good in the system tray. Other people will probably throw in other tidbits...

      -- Eric



      ------------------
      Perfect Sync Development Tools
      Perfect Sync Web Site
      Contact Us: mailto:[email protected][email protected]</A>
      "Not my circus, not my monkeys."

      Comment


      • #4
        OK did all that. It compiled, but no nifty Icon.

        I made a file called Icon1.bmp. Its a bitmap. Is that OK?

        ------------------
        Kind Regards
        Mike

        Comment


        • #5
          No.

          Search your hard drive for *.ICO and try using one of those. PB comes with a few, if I'm not mistaken.

          -- Eric

          [This message has been edited by Eric Pearson (edited June 26, 2001).]
          "Not my circus, not my monkeys."

          Comment


          • #6
            I d/l MircoAngelo - cool!

            Its 30day trialware tho

            That did it. I have a cool Icon now!

            thx guys

            ------------------
            Kind Regards
            Mike

            Comment


            • #7
              What you can do also...is d/l a program to convert BMP to ICO, there are THOUSANDS all over, I'd suggest a site www.hotfiles.com


              ------------------
              Ivan
              www.planetnetworks.com
              Ivan

              Uncle Droid (Android Apps)

              Comment


              • #8
                Mike,

                Whats wrong with using the old image editor that comes with
                PowerBASIC, it will create an icon with no problems at all?

                There is no real problem using a single image size icon, I am
                personally too lazy to draw the 16 x 16 ones as they look lousy
                anyway, the system reduces the size of the 32 x 32 version and
                it does not look any worse.

                Regards,

                [email protected]

                ------------------
                hutch at movsd dot com
                The MASM Forum

                www.masm32.com

                Comment


                • #9
                  > 16 x 16 ones (...) look lousy anyway,
                  > the system reduces the size of the
                  > 32 x 32 version and it does not look
                  > any worse.

                  That's not my experience. Sure, Windows will automatically reduce a 32x32 icon to 16x16 if you don't supply both sizes, but it does that by simply skipping every other pixel. Depending on the icon, that can result in some pretty rough edges and other unpleasant effects.

                  Given the chance, I prefer to create the 16x16 myself so I can make choices based on what it looks like, not an arbitrary conversion algorithm. For example, it's often possible to make subtle color changes to fool the eye into seeing something that isn't there. This is especially true if the icon will be displayed in the system tray. Even a 16x16 will be distorted when it is displayed in the sys tray, so hand-tweaking is the only way to get good results.

                  MicroAngelo makes it easy to convert a 32x32 to 16x16, so you can see what Windows will do to it. If you like the results, save it. If not, tweak it and save it. The most common change I make is shifting the image so that the odd pixels are saved instead of the even pixels. It can make a difference!

                  -- Eric


                  ------------------
                  Perfect Sync Development Tools
                  Perfect Sync Web Site
                  Contact Us: mailto:[email protected][email protected]</A>
                  "Not my circus, not my monkeys."

                  Comment


                  • #10
                    Originally posted by Mike Trader:
                    I d/l MircoAngelo - cool!
                    Its 30day trialware tho
                    I generally use the freeware IconEdit32:

                    IconEdit32 is a 32-bit update to the older PC Magazine utility IconEdit, by Michael Mefford. It's a complete rewrite, with no old code retained. Where IconEdit was limited to single-image 32x32 16-color icons, icons created using IconEdit32 can include all valid combinations of size and color depths - up to nine images.

                    Search ZD-NET for it.




                    ------------------
                    Check out my free software at http://www.lexacorp.com.pg(all written in PB/DLL)

                    Comment


                    • #11
                      JFYI, the only "ICONEDIT32" I could find on www.zdnet.com was shareware, not freeware.

                      Maybe I found the wrong IconEdit?

                      ------------------
                      Lance
                      PowerBASIC Support
                      mailto:[email protected][email protected]</A>
                      Lance
                      mailto:[email protected]

                      Comment


                      • #12
                        I use Norton IconEdit, 16 bit, released sometime in the 80's, works great tho!

                        Does not do 32 bit icon or 32x32, but then does anyone else besides winzip and MS? Maybe...

                        Maybe time for me to upgrade hehe..

                        ------------------
                        Scott
                        Scott Turchin
                        MCSE, MCP+I
                        http://www.tngbbs.com
                        ----------------------
                        True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

                        Comment


                        • #13
                          Give this program a whirl!!!!! Great conversion program.
                          http://www.ryansimmons.com/users/irfanview/

                          Cheers,
                          Cecil

                          ------------------

                          Comment


                          • #14

                            I find that most icons created at 16x16 pixels look quite smart when windows sizes them to 32x32, try that and see what you get!



                            ------------------
                            Kev G Peel
                            KGP Software, Bridgwater, UK.
                            mailto:[email protected][email protected]</A> http://www.kgpsoftware.com
                            kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                            Comment


                            • #15
                              Originally posted by Lance Edmonds:
                              JFYI, the only "ICONEDIT32" I could find on www.zdnet.com was shareware, not freeware.

                              Maybe I found the wrong IconEdit?

                              The link is still there to the March 2000 article in PC Magazine when they published it , but the download link doesn't work and it is no longer shown in their Free Utilities list where it used to be :-(

                              The article is at http://www.zdnet.com/pcmag/stories/s...444578,00.html

                              Looks like they cut the link when the author created the updated Shareware version, however it is still on their site. A Copernic search quickly foudn the following link which still works at this time.
                              http://www.zdnet.com/downloads/stori...,,00165P,.html




                              ------------------
                              Check out my free software at http://www.lexacorp.com.pg(all written in PB/DLL)

                              Comment


                              • #16
                                I d/l Icon edit - thx stuart.

                                So now, I have my Image that I made in MicroAngel. It was 64x64 in 256 colors. It compiled and produced a wonderfull Icon of 3 red and green candlesticks that looked perfectly proportioned in and open/save dialog, in a folder and on the destktop as a shortcut.

                                Now I open it with IconEdit and it says 64x64 is illegal! So i make 48x48 in Microangel and open it ok in IconEdit. Then I have to tweak it to get the proportions correct again and save it.

                                When I compiple it the new program icon is no longer in correct proportion.

                                I assume this is because it is interpolating from 48 to 32?

                                Icon Edit says:
                                A Windows icon can contain multiple images. When Windows goes to display the icon, it will choose the image that best matches the required size and color depth. If there is no exact match, it will stretch or shrink the closest available image. There are three valid image sizes, 48x48, 32x32, and 16x16. There are also three valid color depths, 2-color, 16-color, and 256-color.

                                So what do I do?

                                Should I make one 32x32 and let windows figureit out?

                                Should I copy and paste in IconEdit and make em all (very simple)

                                I just want a correctly proportioned icon again sob sob ...



                                ------------------
                                Kind Regards
                                Mike

                                Comment


                                • #17
                                  > copy and paste in IconEdit and make em all (very simple)

                                  Doing that will give you the best results. It also allows you to tweak the individual images.

                                  -- Eric

                                  ------------------
                                  Perfect Sync Development Tools
                                  Perfect Sync Web Site
                                  Contact Us: mailto:[email protected][email protected]</A>
                                  "Not my circus, not my monkeys."

                                  Comment

                                  Working...
                                  X