glow effect to a form using GDI+

tyonuts

Well-known member
Joined
Dec 27, 2005
Messages
78
Location
Romania
Programming Experience
3-5
Hi everyone. My question is: how can you add a glow effect to a form using GDI+? I mean, something similar to Adobe Acrobat's Splash Screen? Using a png seems to work, but only until the form is repainted (eg: when i move the form).
And another one: I tried creating a control that inherits from RichTextBox. I need to make it transparent, so I used SetStyle. The problem is, when I use the UserPaint method, the background is transparent, but the text isn't visible anymore. How can I repaint the text, so that I can still have scrollbars available? Thanks a lot in advance!
 
Last edited by a moderator:
well, before I move it, nothing happens. While I move it, the image becomes fragmented. I know I could use transparencykey, but I need translucency, not total transparency. pls help
 
Sorry it took so long to come back
I set the Background Image to be a png of my choice. That's the only way to display translucent areas of the form, so that i'm able to see through it (for example, a window placed on the desktop will show me the desk, but with the blending of the png enabled.) I'm not writing from back home, so i'll post a screenshot in a couple of days.
 
But doesn't the PNG end up being translucent as well? What I mean is, how are you doing it so that some parts of the form are 0% opaque and others 100%? Or are you?

Also, as a suggestion, if your form doesn't have double buffering enabled, try enabling it.
 
just try to do this yourself
start up photoshop, create a document with transparent back, draw a gradient on it, set the layer's opacity to 50% or such and save the file as png
then set the backgroundimage property of a form (in vb) to that png. please note you have to do this in design mode
then run and tell me what happens
 
You don't actually need to create a .png. You can do all this with GDI+ just set up a lineargradient brush use a color FromARGB(0,0,0,0) will do the trick and paint it onto your form.
 
you don't get it do you?
create a png with multiple values of transparency
then set it as the form's back image
run the new app
and try to move the form
you'll see

if i have the time, i'll bring some screenshots from back home ('cause i'm typing from school)
 
No my friend, you don't get it. I don't know why you are using a .png cos GDI+ is better.

Put this is the forms contructor...

VB.NET:
SetStyle(controlStyles.AllPaintingInWmPaint,true)
SetStyle(ControlStyles.DoubleBuffer,true)
SetStyle(ControlStyles.UserPaint,true)

Them in the forms OnMove event..

Me.Invalidate
 
Ok... I created an empty project, set the form's background image to a PNG I already have that has pixels that vary in opacity from 0 to 255, and played around with double buffering, setting styles, invalidating...all that. The result is always the same... the background image is painted over the form's existing background (SystemColors.Control). I never see anything from behind the form. What am I missing here?
 
Back
Top