Solved

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

Posted on 2013-06-06
1
379 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

DevOps Toolchain Recommendations

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

Question has a verified solution.

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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

23 Experts available now in Live!

Get 1:1 Help Now