CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2000
    Posts
    66

    How build small icon and large icon in a vb application?

    I want to make my vb program a small icon and a large one. That means when we
    browse the file in "explore" of windows, it can display small icon and large
    icon after user select the view type of "Large Icons" and "Small Icons". In VC
    we can do it in the resource file, but in VB, how ?

    Urgent!

    //-----------------------------------------\\
    Where there's a wire , there's a way
    \\-----------------------------------------//

  2. #2
    Join Date
    Feb 2001
    Location
    UK
    Posts
    39

    Re: How build small icon and large icon in a vb application?

    Explorer handles converting the 16x16 icon if none exists - which is normal for a VB application.
    If you assign a normal 32x32 icon to a form (via the icon property) and compile the exe, on the Options you can specify what icon you want to give the exe (only one though).
    In Explorer, it then 'reduces' the 32x32 large icon to give a 16x16 icon in list, small icon, and report views.

    If this is not the case for you, let me know...


  3. #3
    Join Date
    Dec 2000
    Posts
    66

    Re: How build small icon and large icon in a vb application?

    That's the problem. I want to make the Explore display my own another 16*16 icon when we
    change the "views type" to Small Icons. Means I want to insert two different icons in the
    VB programe and Windows can handle.

    //-----------------------------------------\\
    Where there's a wire , there's a way
    \\-----------------------------------------//

  4. #4
    Join Date
    Dec 2000
    Posts
    66

    Re: How build small icon and large icon in a vb application?

    That's the problem. I want to make the Explore display my own another 16*16 icon when we
    change the "views type" to Small Icons. Means I want to insert two different icons in the
    VB programe and Windows can handle.


    //-----------------------------------------\\
    Where there's a wire , there's a way
    \\-----------------------------------------//

  5. #5
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: How build small icon and large icon in a vb application?

    A .ico file can store more than one actual icon in it.
    If you store the 32x32 icon then the 16x16 icon in the one file and assign this file to VB form, does explorer pick up the correct version?

    -------------------------------------------------
    Got "BigMetalHead"? You will soon
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  6. #6
    Join Date
    Dec 2000
    Posts
    66

    Re: How build small icon and large icon in a vb application?

    Really?
    How to store 16x16 and 32x32 icons into only one .ico file?

    Thanks.

    //-----------------------------------------\\
    Where there's a wire , there's a way
    \\-----------------------------------------//

  7. #7
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: How build small icon and large icon in a vb application?

    An icon file always starts with a structure called the ICONDIR structure.
    In VB this structure would be:

    Type ICONDIR
    idReserved as Integer 'not used in Win32
    idType as Integer 'Always set to 1 in Win32
    idCount as Integer 'Number of icons in this file
    End Type




    Following that are however many the value in ICONDIR.idCount times a structure known as an ICONDIRENTRY.

    Type ICONDIRENTRY
    bWidth as Byte '16,32 or 64 pixels wide
    bHeight as Byte 'Should match bwidth
    bColourCount as Byte
    bReserved 'must be set to zero
    wPlanes as Integer 'number of colour planes
    wBitCount as Integer 'bits per pixel
    dwBytesInRes as Long 'size of icon at default res
    dwImageOffset as Long 'Start of image offset from start of file
    End Type




    Using this windows will look through every ICONDIRENTRY in an icon file and display the nearest match to your display characteristics. Only if no match is found will it alter another icon.

    There should be an editor that supports this - probably in MSDN. If not, let me know and I will add it to the list of things that I will cover in my "BigMetalHead" column and let yopu know when this is done.

    HTH,
    Duncan


    -------------------------------------------------
    Got "BigMetalHead"? You will soon
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  8. #8
    Join Date
    Feb 2001
    Location
    UK
    Posts
    39

    Re: How build small icon and large icon in a vb application?

    If you go to download.com and type 'icon editor' it should find a fair few dozen...
    Its shareware, but powerful (and no, I didn't write it!) but IconForge is good...


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured