Solved

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

Posted on 2011-02-22
8
749 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
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
 
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
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.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

930 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