DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
Go Back  Xtreme Visual Basic Talk > > > > DirectX 8 Permanent Rendering


Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2005, 02:35 PM
steven_j steven_j is offline
Newcomer
 
Join Date: Feb 2005
Posts: 16
Default DirectX 8 Permanent Rendering


Is it possible to render a DirectX 8 viewport to a picturebox permanently, such that standard graphics routines could be used with the picturebox?
Reply With Quote
  #2  
Old 07-30-2005, 12:56 PM
TheHoplite's Avatar
TheHoplite TheHoplite is offline
Centurion
 
Join Date: Jan 2005
Posts: 100
Default

Quite funny this. I read your post and thought 'Ah! Someone's asked a similar question before. I'll guide them to the post that tried to tackle this problem'. When I found the post, I realised that it was you who started that topic off some time ago!

Anyway...I have looked into the problem. I must admit that I haven't fully solved it yet but what I have done is a start.

Render your Direct3D images to a picture box and present them. Then draw your lines and circles on to the picture box. You said previously that you did this but the image was very flickery. To eliminate the flicker, you'll need to copy the image in the picture box to your main picture box (same principle as double buffering). To do that,you could use the windows API BitBlt function:

Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

hDestDC: The device context of the picture box you're blitting to.
X,Y: The X and Y coordinates of the where you want the image to be drawn to.
nWidth,nHeight: The width and height of the image you want to copy.
hSrcDC: The device context of the picture box you're copying from.
xSrc,ySrc: The X and Y coordinates of the image you want to copy.
dwRop: The Blitting operation. In other words, what do you want the function to do? Because you want to copy a picture, you need to pass &HCC0020 in this parameter.

I've attached some source code to demonstrate this principle. When you run the program, you will see two picture boxes: one with a flickery image and the other with a nice and stable image.

The only problem with this program is that it doesn't work if the picture box is hidden. This is something I have not yet found out how to remedy, but I'm still looking into it. Hopefully, either you or some other members can help out here.

--The Hoplite
Attached Files
File Type: zip DX.zip (8.1 KB, 14 views)
__________________
VDXLib: Open Source DirectX Library for Visual Basic. http://vdxlib.sourceforge.net/
Latest news 30 Sep 2005:
-DirectAudio8 library RELEASED - DirectAudio8 FULL documentation RELEASED - DirectAudio8 samples RELEASED
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
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
 
DirectX 8 Permanent Rendering
DirectX 8 Permanent Rendering
 
-->