Solved

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

Posted on 2011-02-22
8
748 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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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
Comment Utility
Okay. An admission here. How do I load the Icon class?
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:gbmcneil
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you for your help.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This video discusses moving either the default database or any database to a new volume.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now