Solved

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

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

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