Click here to Skip to main content
13,147,540 members (32,715 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Anyone know of a way of converting an icon to a bitmap that would be larger than 32 x 32? I am trying to display the icon that a user chooses, but 32 x 32 is a tad bit too small. I know I need an icon to be larger than 32 x 32 in the first place, which I do, but the
seems to only do 16 x 16 and 32 x 32 regardless how big the icons are.

Thanks in advance.
Posted 1-Jul-12 11:43am
Updated 1-Jul-12 11:44am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It makes no sense, usually. Well, how larger? The bitmaps are usually too small; sizes of 40x40 or 64x64 can be considered as very big, you hardly can find any bigger. Also, makes sure you have a legal rights to use some available bitmap the way you want.

But the most important factor is this: you can re-sample any bitmap down with acceptable quality, unless extreme cases of a very small ones (16, or 32 pixels are already small), which usually requires manual improvements, which in turn requires special skills and experience. As to the enlargements, all automatic re-sampling methods gives quite lousy quality. (Ever heard of information entropy,[^]?)

For more or less large images (say, some 50 pixels and more), it's way more beneficial to create and store vector image. Each time you need a bitmap, you should scale a vector image to the size of the bitmap (or more, for subsequent re-sampling down later), and export it as a bitmap. The exported bitmaps can be used to create icons as well. One highly recommended product is the open-source Inkscape, please see:[^],[^].


Sorry for misunderstanding. There are more than one bitmap in the icon. Extracting them is easy enough. Please see this CodeProject article:
Extracting and displaying icons with VB.NET[^].

Pay attention for the class IconImage and see how it works in the code which comes with the article.

Rokas Gustys 1-Jul-12 19:53pm
Thanks, for the reply. But there must be a way to do it. There are icon viewers made in VB 6 that allow you to view even a 256 x 256 icon, but I have no idea how to do it in VB.NET 10
To do what? To re-sample a bitmap up and get perfect quality? Did you ever heard that there is no such thing as miracle? Technical means can only assist you. The best method I tries was the fractal compression method, it allows for enlargement, but for bigger source files and with limited quality, which is always limited. Understand finally, that with a small bitmap you have not enough information... Again, use it as a guide to vectorize...

By the way, did you vote "3". If you did, why?
Rokas Gustys 2-Jul-12 7:11am
I though my question was clear enough if you actually read it. I don't want enlargement. Look I have an icon file that has a 256 x 256 32-bit depth quality icon in, and I simply asking for a way to convert that icon data into bitmap data, one file type to another simple as that. So far I only know of one but it limits me to only 32 x 32 in size, which is really small. I appreciate you're answer, but I will not stop until I find away, because I know there is one.
OOPS! I don't know why I had the impression that you need to re-sample it, probably was distracted by your "larger", sorry about that.
Do you need to extract bitmaps from the icon programmatically, in your code, or you need just to do it somehow?
Please see my update above, after [EDIT].
Rokas Gustys 4-Jul-12 7:32am
Thanks, I've seen it before but it doesn't seem to work, I get all kinds of errors. Fixing one gives me another. Looking at the code it seems he is stripping the very pixels of the icon and putting them into a bitmap format. That is far beyond me. I'm using Visual 'BASIC' for a reason haha XD. I've tried something with it but nothing works. It was also made in Visual Studio 2008, I am using 2010 - maybe that's where the problems are coming from?

Hmm... I guess this is much hard to achieve than I thought.
Himachandra 6-Jul-12 4:00am
Nice ...... My 5
Rate this: bad
Please Sign up or sign in to vote.

Solution 2


It works, just gotta must make sure the icon only contains the size you want or try somehow splitting the icon into different sizes and then using it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 5 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100