Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Watermark Overlay using GDI+ ??

Status
Not open for further replies.

avarga82

Programmer
May 19, 2003
62
US
Hello...

I have a need for a watermark to be displayed on a form, visible over any/all controls on the form. I can't draw it directly to the form or a panel, as controls can be placed on top of those...I need to draw a watermark above everything.

Is this possible? If so, a point in the right direction would be most appreciated.

Thanks!
 
I've downloaded and tried the XPWatermark from SteepValley. It's great if you need a watermark to be shown behind controls, but does not support transparency to be shown on top of controls. I need a watermark to be drawn over any and all controls on a form. I'm not sure if this is even possible...
 
Can this be done in .NET? Mr. Google has been no help...
 
Have you tried Rick's suggestion?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Actually, I'm really surprised you didn't find anything on google - I typed in "VB.NET" watermark and hit "I'm feeling lucky" and even that seemed to do what you want (and that's without going through any of the other results).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I can find articles on Google for adding a watermark to an image or a panel, but I don't need to draw it on one control, i need it to "float" above all textboxes/combos/controls/etc on the form. I haven't found anything on BITBLT and .NET, and was just wondering where to go to get more info on that.

Thanks!
 
Can't you just take that functionality and apply it using Rick's suggestion of a form sized picture box?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Like I said, I can find plenty of results (ie, "vb.net" bitblt) for adding watermarks to images, or panels, or forms, etc. I cannot find anything relevent for showing a "floating" image above any controls. I would really appreciate a link or a tip as to how to achieve this...
 
To quote myself:
One option would be to make a form sized picture box. Set the background to transparent. Then use BITBLT to put your water mark on the picture box.

Stick that picturebox on top of all other controls on the form. The whole thing could be done programaticly so you wouldn't have to deal with the picture box in the form designer.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
try a form in a form and setting the subforms opacity make it a white background with black text and it should really work. if you move the form to front.

You can add forms to the controls collection of another form

Code:
dim frm as new form2
frm.toplevel = false 'this is a property that intellisense seems to forget mentioning.
me.controls.add(frm)
frm.visible = true
frm.movetofront
frm.opacity = 10

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
this is a property that intellisense seems to forget mentioning.
Chrissie, for some reason it's classed as an advanced member. If you go to Tools->Options->Text Editor->Basic and uncheck the "Hide Advanced Members" checkbox, it will appear.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Oops, sorry. But it doesn't seem to be advanced in .net 2005.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Good idea chrissie, but also don't forget to set the FormBorderStyle property to None.

[vampire][bat]
 
I know I keep beating this horse, but it's not dead yet...

I can add a form to the controls collection of another form. However, you can't set the opacity or transparency key of the form that's being added, only the container form. This defeats the purpose of making part of the overlay transparent.

We're close...any more ideas?
 
I went at it a different way than trying to add a form as an owned control. What I did was creat a path, then draw a string on the path. I filled the path with a solid brush, then created a region from the path, which will only print on screen the string you specified. All else is completely transparent.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top