Transparent background
Transparent background
Transparent background
Transparent background
Transparent background
Transparent background Transparent background Transparent background Transparent background Transparent background Transparent background Transparent background Transparent background
Transparent background Transparent background
Transparent background
Go Back  Xtreme Visual Basic Talk > > > > Transparent background


Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2006, 07:56 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default Transparent background


Hi there,

Im making a little desktop widget for myself using DX, its like a toolbar where I could put my favorite games, programs etc. The reason why I use DX is simply because GDI+ is slow when I want to make cool effects on hover and so on...

Now to the problem, I want to make everything behind my toolbar items transparent, the area I draw on simply covers the whole form, I'v yet not seen any examples on this, so I was wondering if its even possible? And If maybe someone know how to do this?

In advance, Thanks
__________________
~ St!gi
Reply With Quote
  #2  
Old 02-16-2006, 04:21 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

I understand the effect that you are looking for. They use it in Windows Vista. It's called Glass and is a big part of the new Aero desktop. You might be able to get the API for that on the net somewhere?

Have you tried creating your own ActiveX control which does this and add it to your form? So your control would have the minimize, maximise and close buttons so you can still keep control of the form that way.
__________________
Cheers
Reply With Quote
  #3  
Old 02-16-2006, 05:20 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default

Quote:
Originally Posted by ardman
I understand the effect that you are looking for. They use it in Windows Vista. It's called Glass and is a big part of the new Aero desktop. You might be able to get the API for that on the net somewhere?

Have you tried creating your own ActiveX control which does this and add it to your form? So your control would have the minimize, maximise and close buttons so you can still keep control of the form that way.
Thanks for the reply!

Your'e talking about the Minimize, Maximize and Close button on a form, am I correct?

Then you didn't quite understand what I meant, which means I asked in a stupid way, lets try again.

I have a form.
I draw on the whole form using DirectX.
What I draw is several pictues (items) used as shortcuts. (Like the OSX toolbar on the buttom).
The background (everything behind the pictures (items) I draw) should be transparent, so when I have this program on my desktop, all I see is the pictures (items) I can click on. And ofcourse then the desktop in the background...

If you still dont understand completely what I want I could make some screenshots.

Cheers
__________________
~ St!gi
Reply With Quote
  #4  
Old 02-16-2006, 05:23 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

So, what you are effectively doing is creating a fullscreen form with your own icons on it and then you want that form to be transparent to see the Windows desktop?
__________________
Cheers
Reply With Quote
  #5  
Old 02-16-2006, 06:13 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default

Quote:
Originally Posted by ardman
So, what you are effectively doing is creating a fullscreen form with your own icons on it and then you want that form to be transparent to see the Windows desktop?
Yes, that should be about right, but the form is a x width and x height, not fullscreen, but that doesn't matter.
__________________
~ St!gi
Reply With Quote
  #6  
Old 02-16-2006, 07:08 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

Not quite sure if thats possible to be honest, unless you had a clear background colour and the same colour was chosen as your transparency colour. When you have an image it will only be transparent for the colours that are the same in the picture.

I found this link: http://www.ur.co.nz/static/default_t...dataid_399.htm

Not sure if it will help but it is an irregular window.
__________________
Cheers
Reply With Quote
  #7  
Old 02-16-2006, 07:37 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default

Quote:
Originally Posted by ardman
Not quite sure if thats possible to be honest, unless you had a clear background colour and the same colour was chosen as your transparency colour. When you have an image it will only be transparent for the colours that are the same in the picture.

I found this link: http://www.ur.co.nz/static/default_t...dataid_399.htm

Not sure if it will help but it is an irregular window.
Making the form transparent is posible using the property on the form, but then its all flickery and disgusting, not a good solution.

So I hoped there was alphachannel and such implented in DX, which im 99% sure there is.

Also, I'm not sure the irregular window idea would work, but I will give it a try, just to see what happends.

Thanks alot, I'll edit when I have tested.

EDIT:
Okay, so I tested this and it sort of works, but its EXTREMELY slow, so this can't be used at all, too bad

Thanks for the effort anyway
__________________
~ St!gi

Last edited by Stigi; 02-16-2006 at 07:54 AM.
Reply With Quote
  #8  
Old 02-16-2006, 07:39 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

My understanding of the Alpha channel was that you picked a colour which you would use as a ColorKey and that would be the one which would become see-through. I may have the wrong end of the stick on this.
__________________
Cheers
Reply With Quote
  #9  
Old 02-16-2006, 07:55 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default

Quote:
Originally Posted by ardman
My understanding of the Alpha channel was that you picked a colour which you would use as a ColorKey and that would be the one which would become see-through. I may have the wrong end of the stick on this.
Thats exactly what I want, I want to pick a color, and make it transparent. within the DX drawarea.
__________________
~ St!gi
Reply With Quote
  #10  
Old 02-16-2006, 08:00 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

Ok, all you need to do then is change the renderstate to turn on Alphablending. Set the SourceBlend and the DestBlend colours. Once rendered, turn off alphablending.
__________________
Cheers
Reply With Quote
  #11  
Old 02-16-2006, 08:09 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default

Quote:
Originally Posted by ardman
Ok, all you need to do then is change the renderstate to turn on Alphablending. Set the SourceBlend and the DestBlend colours. Once rendered, turn off alphablending.
Ah ok, so I did this:

Code:
DXDevice.RenderState.AlphaBlendEnable = True DXDevice.RenderState.SourceBlend = Blend.SourceAlpha DXDevice.RenderState.DestinationBlend = Blend.InvSourceAlpha

But then I'm not sure what to do, how do I tell what colors etc?
__________________
~ St!gi
Reply With Quote
  #12  
Old 02-16-2006, 08:33 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

I done a quick search and I found this. I believe that this is what you are wanting to do.

Full credit to the author :-)
Attached Files
File Type: zip PerPixelAlphaForm-101.zip (84.3 KB, 87 views)
__________________
Cheers
Reply With Quote
  #13  
Old 02-16-2006, 08:42 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default

Quote:
Originally Posted by ardman
I done a quick search and I found this. I believe that this is what you are wanting to do.

Full credit to the author :-)
C#,

I'll check it out, and edit if new problems occur, thanks again

Edit:
Yep, just as I thought, I cant convert this
Have no clue whatsoever how to do this in VB.Net, or if it even works...this seems hopeless
__________________
~ St!gi

Last edited by Stigi; 02-16-2006 at 08:56 AM.
Reply With Quote
  #14  
Old 02-17-2006, 08:34 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Talking

Quote:
Originally Posted by Stigi
C#,

I'll check it out, and edit if new problems occur, thanks again

Edit:
Yep, just as I thought, I cant convert this
Have no clue whatsoever how to do this in VB.Net, or if it even works...this seems hopeless
I'll try and get round to converting it over the weekend. If not then I'll let you know a DX way of doing it.
__________________
Cheers
Reply With Quote
  #15  
Old 02-17-2006, 08:43 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Lightbulb

Just had another quick search on the net and stumbled across this page by Microsoft.

http://msdn.microsoft.com/library/de...lStudioNET.asp

This may help in what you are trying to do and it's in VB .NET and C# .NET.
__________________
Cheers
Reply With Quote
  #16  
Old 02-17-2006, 09:39 AM
Stigi's Avatar
Stigi Stigi is offline
Regular
 
Join Date: Jan 2006
Posts: 87
Default

Quote:
Originally Posted by ardman
Just had another quick search on the net and stumbled across this page by Microsoft.

http://msdn.microsoft.com/library/de...lStudioNET.asp

This may help in what you are trying to do and it's in VB .NET and C# .NET.
Thanks for still trying to help me, although it might seem hopeless

The above link seems to be yet another way to do this, but yet again its not with DirectX, which I need.
__________________
~ St!gi
Reply With Quote
  #17  
Old 05-06-2006, 10:29 AM
cvb cvb is offline
Newcomer
 
Join Date: May 2006
Posts: 1
Cool heyyyy

look i'll tell what i have

i use usually in VB 6.0 < --- i know very OLD

* an API that makes ur frame a transparent by Alpha channel and it can be a click through one so when you click on a component u will fire the action MouseClick for that but if you clicked on the frame it self it will be clicked on the component behind i think it will be very usefull for you

* another way is to use CreateRect and setWindowRect which are very usefull but i'm workin on an ActiveX contol that you pass for it the Form and the Color so it will use the above API's to create a transparent for every pixel with that color

anywayz, just lamme know if that what u want coz i don't wanna put it here if u just wanna do it in DX

cheers
CvB
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Transparent background
Transparent background
Transparent background Transparent background
Transparent background
Transparent background
Transparent background Transparent background Transparent background Transparent background Transparent background Transparent background Transparent background
Transparent background
Transparent background
 
Transparent background
Transparent background
 
-->