Solved

How to make 48x48 icons appear larger in VB.NET

Posted on 2011-02-22
8
753 Views
Last Modified: 2012-06-21
Hello Experts -

Is there anyway to increase the display size of a 48x48x32 icon in VB.NET while preserving its quality.

I have tried to "Stretch" the output in a Picturebox to 64x64 and it appears to becoming out fuzzy.

I know it can be done because I have seen renditions of icons by Microsoft that were at least  three times larger than their native display size - and they didn't look that bad.

Any thoughts?
0
Comment
Question by:gbmcneil
  • 4
  • 3
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 34954653
you need a higher-res image. decreasing an image is normally done good but increasing a low-res image is never good.
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 34962662
I have been trying to explain to you in your other question that you want to close. Your using the Icon() class to load the icon then when you draw into the surface it becomes "streched". Even if the icon has multiple supported resolutions. The idea is to figure out if the icon your testing has multiple resolutions because if it does and you use Icon() class you won't draw the correct resolution to the surface.

Using this example do you notice any difference in resoultion?
Dim b As New Bitmap("c:\windows\system32\PerfCenterCpl.ico")
Dim g As Graphics = PictureBox1.CreateGraphics
g.DrawImage(b, 0, 0, 128, 128)
g.Dispose()

Open in new window

0
 

Author Comment

by:gbmcneil
ID: 34962903
Okay. An admission here. How do I load the Icon class?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 34963333
Add PictureBox to Form and 1 button and place the code into button. Do you notice the difference in resolution when running the example below against your previous example?
Dim b As New Bitmap("c:\windows\system32\PerfCenterCpl.ico")
Dim g As Graphics = PictureBox1.CreateGraphics
g.DrawImage(b, 0, 0, 128, 128)
g.Dispose()

Open in new window

0
 

Author Comment

by:gbmcneil
ID: 34963816
If I do as you say, the result is to zoom in on the image - making it appear grainer.
0
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 250 total points
ID: 34965428
Then it seems that your icon has a max resolution of 64x64. What I am trying to explain is that if the icon had higher resolutions and you still used the Icon Class and DrawIcon then it would still draw into the surface blurred.

The icon "c:\windows\system32\PerfCenterCpl.ico" is a perfect example of microsoft icon with multiple resolutions. But if you had loaded it with the Icon class it would still become blurred when using DrawIcon even though it supports higher resolutions 128x128 256x256

0
 

Author Comment

by:gbmcneil
ID: 34965926
Interesting. It's like a TrueType icon.

But, how do you know its a TrueType icon?  I would think that all the fonts found in Shell.dll (a Microsoft file found in System32) would be expandable.

Is it just trial and error?  Are there any DLLs that house collections of Microsoft's expandable icons?
0
 

Author Closing Comment

by:gbmcneil
ID: 34988157
Thank you for your help.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question