Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-02-22
8
Medium Priority
?
760 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 
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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

705 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