Solved

A way to change the alpha of the icon before Graphics.DrawIcon?

Posted on 2013-06-06
1
389 Views
Last Modified: 2013-06-06
Hello, I am drawing an icon to the screen with:

pe.Graphics.DrawIcon(My.Resources.MyIcon, x, y)

I was wondering if there was a way to adjust the alpha of the icon to a desired number before drawing, like the following imaginary code that fades it in:

for n as integer = 1 to 255
dim alpha_icon as new icon(My.Resources.MyIcon)
alpha_icon.SetAlpha(n)
pe.Graphics.DrawIcon(alpha_icon, x, y)
next n

I have seen ways to do this with image resources, haven't been able to find an equivalent for icons.

Thanks for any help.
0
Comment
Question by:RonMexico
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39225296
An icon is just a special bitmap. Try loading a copy of the resource into a Bitmap instance; then fiddle with the alpha there.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

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…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 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