Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video
Displaying an image over a 3d application or video Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Go Back  Xtreme Visual Basic Talk > > > Displaying an image over a 3d application or video


Reply
 
Thread Tools Display Modes
  #1  
Old 02-14-2008, 01:56 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default Displaying an image over a 3d application or video


Hi! This is an important question since I might start a large project if certain aspects are doable.

In short, I'd like to show images(perhaps even an animation) over any 3d application such as games. For example, while playing a certain recent 3d game, I'd like for my app to be running in the background and at a certain point in time, display a picture over the said game.

I know this is possible because of specific applciations like Xfire that make menus pop over a game to enable chatting while in-game.

Please guys, any sign of hope would be killer. Thanks!

Last edited by 7h0m; 02-14-2008 at 05:15 PM.
Reply With Quote
  #2  
Old 02-14-2008, 02:23 PM
Gruff's Avatar
GruffDisplaying an image over a 3d application or video Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Welcome to the forum 7h0m. Be sure to read the forum Posting Guidelines.

I assume you have VB.NET (some version).

In short you can write a program that drives a window that always stays on top of the WinXP Z-order. This window may be positioned over your game window as well, although I doubt you will be able to have it react in any way to the contents of the game.

Neither of these things is particularly difficult.

~T
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #3  
Old 02-14-2008, 02:46 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

Quote:
Originally Posted by Gruff View Post
Welcome to the forum 7h0m. Be sure to read the forum Posting Guidelines.

I assume you have VB.NET (some version).

In short you can write a program that drives a window that always stays on top of the WinXP Z-order. This window may be positioned over your game window as well, although I doubt you will be able to have it react in any way to the contents of the game.

Neither of these things is particularly difficult.

~T
This forum has proven to be very efficient with only one view, but one awesome reply. Thanks a dozen, I also don't need to have any interaction between the game and the window. This is great news.

I might come back for specific guidelines if i fail to do it by myself. But if you can confirm me that there is a property that forces a window ontop of a 3D app... I'm all dandy.
Reply With Quote
  #4  
Old 02-14-2008, 03:29 PM
Qua's Avatar
QuaDisplaying an image over a 3d application or video Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

There are a few APIs that you might find useful. Look up GetForegroundWindow in particular.
Reply With Quote
  #5  
Old 02-14-2008, 04:02 PM
Gruff's Avatar
GruffDisplaying an image over a 3d application or video Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

With VB.NET 2005 or 2008 the Desktop application Form object has a 'Topmost' boolean property that does what you want. Locating your game window size and location would be an API call.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #6  
Old 02-15-2008, 02:01 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

ok I tried using the Topmost method and it does NOT work for full screen applications.

I found another example of what i am trying to achieve: http://www.gameoverlay.com/

so I know it is possible... I just need to find out how! Plz help me in this quest great vb wizards.
Reply With Quote
  #7  
Old 02-15-2008, 02:33 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

Reply With Quote
  #8  
Old 02-15-2008, 02:43 PM
AtmaWeapon's Avatar
AtmaWeaponDisplaying an image over a 3d application or video AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

I'm not well-versed in this, but I do have a basic understanding.

If you envision your monitor as having several layers, it makes things easier. The bottom layer is your desktop, above that is your application windows. All is good, and setting a form as topmost will make your form at the top of this virtual layer. DirectX actually renders on top of this layer, so there's probably not a way to make a normal GDI or GDI+ something or the other appear over DirectX. This is part of why if you are playing a game or watching a movie in Windows Media Player, the Print Screen key doesn't take a screenshot of the DirectX content (unless the game has added special support for it).

I can deduce the process that might lead you to what you want based on how I would do it to a GDI application, but I cannot guarantee that this will work or that it's even the right way to approach this in DirectX. I know that DirectX, at its core, still uses a window that is registered as a Window Class to host its application. There's probably a way to find the application via its Window Class, then get a handle to its DirectX device context. From there, you can draw using DirectX methods. Doing this from .NET is probably going to be painful, difficult, buggy, and hard.

Unless you already have a good bit of experience and knowledge of DirectX, I'm going to suggest you pay the $25 for this program that was linked in the forum you posted about, or dig around for a free equivalent. When I think of the fact that I have very little knowledge of even the fundamentals of DirectX, then I add that this is a fairly advanced topic that would require extended learning and experimenting, I bet it'd take me a month or more of research plus another few months to implement something that halfway works and is buggy. I'd rather pay $25 and get it over with.

I know it's possible because I've used several overlay tools in the past, but I have absolutely no knowledge about how to pull it off.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #9  
Old 02-15-2008, 02:54 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

GameOverlay does indeed exactly what I want. But the problem is that this phase is only part of my whole project. I basically want to make an application to let users send short webcam clips while playing online. I would try to sell it, thus I can't depend on this app. I was even hesitant on writing the concept down publicly because I think it's a fantastic idea. I must find out how and do it.

I will start looking into DirectX's window class. If Xfire and Gameoverlay can, i have to try. Where would you recommend me asking about such task? any specific forum you might suggest?

Thanks a bunch.
Reply With Quote
  #10  
Old 02-15-2008, 03:03 PM
AtmaWeapon's Avatar
AtmaWeaponDisplaying an image over a 3d application or video AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

I'd start with a bookstore, preferably one with a near-inexhaustible stock like amazon.com. You're going to need good fundamental knowledge of DirectX to make this work; unless you're particularly talented you're not going to get a commercially viable application out of a few online tutorials and the MSDN documentation. It'd probably be a good idea to write a game that includes this functionality first, then get down to the dirty details of trying to force yourself into another application.

That is, unless someone here knows how to do it; I'm admittedly short on knowledge here.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #11  
Old 02-15-2008, 03:03 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

Atma! I found something valuable. Check it out: http://www.gamedev.net/community/for...opic_id=359319

it's an example of a black square overlay on top of a full screen D3D app. Please give me some feedback as if it might be possible to do via VB.
Reply With Quote
  #12  
Old 02-15-2008, 03:04 PM
AtmaWeapon's Avatar
AtmaWeaponDisplaying an image over a 3d application or video AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

No idea. DirectX is unmanaged, but there are managed DirectX extensions. I know nothing other than the very very basics of unmanaged DirectX.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #13  
Old 02-15-2008, 03:23 PM
7h0m's Avatar
7h0m 7h0m is offline
Regular
 
Join Date: Feb 2008
Posts: 64
Default

is DirectDraw well implented into VB? I could also be switching to C++ using visual studio but even if I did my share of mathematics apps using C++ I have almost no idea on how to build a win32 interface.

So are DirectDraw extensions/modules in vb flexible?
Reply With Quote
  #14  
Old 03-29-2008, 05:26 AM
Qua's Avatar
QuaDisplaying an image over a 3d application or video Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

This is just a though: Wouldn't it be possible to just extract the device from the windows handle and then paint to that?

Would be something like:
Code:
 Dim hdc As IntPtr
        Dim aProcess() As Process = Process.GetProcessesByName("SomeProcess")
        If aProcess.Length = 0 Then : Exit Sub : End If
        Dim TheProcess As Process = lolboy(0)
        hdc = GetDC(TheProcess .MainWindowHandle)

        Try
            Dim g As Graphics = Graphics.FromHdc(hdc)

            Try
                'g.DrawString(TextBox1.Tex, New Font("Ariel", CType(TextBox2.Text, Single), FontStyle.Regular), Brushes.Red, TextBox3.Text, TextBox4.Text)
                g.FillPie(Brushes.GreenYellow, New Rectangle(50, 50, 150, 300), 5, 180)
            Finally
                g.Dispose()
            End Try
        Finally
            ReleaseDC(IntPtr.Zero, hdc)
        End Try
__________________
Reading is the foundation for all knowledge - Unknown.
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
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
 
Displaying an image over a 3d application or video
Displaying an image over a 3d application or video
 
-->