|
-
February 15th, 2001, 03:51 AM
#1
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
\\-----------------------------------------//
-
February 15th, 2001, 04:33 AM
#2
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...
-
February 15th, 2001, 07:04 AM
#3
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
\\-----------------------------------------//
-
February 15th, 2001, 07:05 AM
#4
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
\\-----------------------------------------//
-
February 15th, 2001, 09:56 AM
#5
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
-
February 15th, 2001, 10:57 PM
#6
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
\\-----------------------------------------//
-
February 16th, 2001, 04:10 AM
#7
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
-
February 16th, 2001, 05:06 AM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|