Click here to Skip to main content
15,867,949 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi everyone!
I am new to this forum and this is my first question, so please don't judge me too strict.

I am using DirectX for some very simple graphics in my VB.net office Add-in. However, I can not make the background of the directX device to become transparent. There is not much info on the web, so I am counting on you! Please help!

I could not use WPF because there is no paint event, yet I need my graphics to be dynamic and move together with the cursor.

Please help!!!


Thanks
Posted
Updated 25-Sep-12 20:43pm
v2
Comments
Sergey Alexandrovich Kryukov 24-Sep-12 13:12pm    
Why DirectX? Not WPF?
--SA
Sandeep Mewara 26-Sep-12 2:53am    
OP replied:
Sergey, Thanks for your reply. I would not mind using something instead of directX, if it would provide good performance result for Office graphics. However, I am absolutely new to WPF and never had a chance to use it. Can you please guide me, where I should start in order to achieve my goal faster. Basically I need a transparent rectangle over transparent form. Currently I am using built in Graphics methods. Thanks!!!
[no name] 25-Sep-12 4:11am    
Sergey,

Thanks for your reply.
I would not mind using something instead of directX, if it would provide good performance result for Office graphics. However, I am absolutely new to WPF and never had a chance to use it.

Can you please guide me, where I should start in order to achieve my goal faster.
Basically I need a transparent rectangle over transparent form. Currently I am using built in Graphics methods.

Thanks!!!
Sergey Alexandrovich Kryukov 26-Sep-12 17:20pm    
Then you really need to know some WPF. Using other libraries with DirectX is real pain, I know from experience, but basically, WPF is a cultured and very advanced way of using DirectX indirectly (!) while providing its performance, and a lot more, in an absolutely smooth way.

As to the guide. Perhaps, you need to review the WPF introduction first and perhaps start development of simple skeleton applications, to get the feel of it. Then, if you can explain your primary goals and your ultimate goals, ask particular question(s).

Well, the transparent rectangle is not quite one of them. In WPF, unlike Forms, everything is transparent by definition, it's just the property like color. It's relatively usual thing, for example, to have overlapping semi-transparent UI controls (UI elements, more exactly).

--SA
Sergey Alexandrovich Kryukov 26-Sep-12 17:20pm    
And please see my updated answer, after [EDIT].

Also, I think you can accept my answer formally (green button) -- thanks.
--SA

Have a look at SlimDX[^], it's pretty feature complete.

Best regards
Espen Harlinn
 
Share this answer
 
I suggest you use WPF instead. With VB.NET and .NET Framework 3 and later, you can use WPF which is based on DirectX, provides its performance, but is millions time easier and safer to use.

[EDIT]

Thank you for clarifications. Please see my comment to the question, in reply to the comment on transparent window and rectangle. As I say, you need to start with overview and simple things, but transparency is not actually one of the problems, unlike Forms. Please start here:
http://msdn.microsoft.com/en-us/library/ms754130.aspx[^].

Most likely, you will be able to proceed by yourself. If you face some problems, ask some more specific questions.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900