Image opacity

G

Guest

Hi,

I wonder if it was possible to change the opacity of an image in a picturebox for example :
I try to make a splash screen that shows up images (one after one). But i would like to change the opacity of the images as the program loads itself... like a progressbar..

And is there a way to make the image b&w too?

Do I need a special library?

thx
 
N

Nicholas Paldino [.NET/C# MVP]

Baramuse,

I would custom paint the splash screen in this case. What you do is
start by blanking out the image, or flooding the background with the color
you want. Once you do that, you can call the DrawImage property on the
Graphics class to draw your images. You want the overload that takes an
ImageAttributes instance. You would construct this instance and set the
ColorMatrix in the image so that it has an alpha value.

Then, as time progresses, you would fade out one image (set the alpha in
increments to 100) and fade in the other (set the alpha in increments to 0).

Check out the document on MSDN titled "Using a Color Matrix to Set Alpha
Values in Images", located at (watch for line wrap):

http://msdn.microsoft.com/library/d...x_to_set_alpha_values_in_images_usecsharp.asp

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Baramuse said:
Hi,

I wonder if it was possible to change the opacity of an image in a picturebox for example :
I try to make a splash screen that shows up images (one after one). But i
would like to change the opacity of the images as the program loads
itself... like a progressbar..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Form - Prevent Flicker when changing Opacity 1
Opacity on pictureBox 1
Form opacity 1
Transparency Control 2
Fade PictureBox 1
C# Webbrowser vs MSHTML rendering 0
window opacity 5
Flicker in setting opacity. 2

Top