Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Now I draw video sources to the video at WM_PAINT message.

basically when I receive a frame from my source, I call Invalidate() and in the OnPaint message I draw my frame with
screenDC.BitBlt( clpRect.left, clpRect.top, clpRect.Width(), clpRect.Height(), &m_dbd.memDC, clpRect.left, clpRect.top, SRCCOPY );

when I have many fps to show, with this architecture I have performance problem, in another question many people suggested me to pass to a directx architecture in order to improve performance. I try to search on internet some tutorial, but all of them are very complicated, they teach how to work with complex geometric objects, texture, 3d etc... rather I need something easier, I need just to paint my bmp frame (stored in memory) to the screen, that's it, no advanced texture, no sprite, no geometrics draw, no 3d, just fit my bmp on screen, finish . It shouldn't be really complicated. Where can I find a tutorial or help?
Posted
Updated 4-May-12 4:11am
v2
Comments
druscelli 7-May-12 6:30am    
do you think this solution could be suitable for me?

http://www.codeproject.com/Articles/10172/2D-Blits-in-DirectX-9

In the article says
"Of course, when direct access to the surfaces is not needed, you would be better off using the standard D3D blitting routines, which are hardware accelerated and as a result are faster than the software 2D blits in my code."

So this solution is not hardware accelerated?

1 solution

If you haven't looked at this, it's a good reference:
Improving the Performance of Direct2D Applications[^]

This one is also useful:
Direct2D: Hardware Acceleration in Windows 7 Plotting[^]

[Update]
For XP and OpenGL have a look at PicZoom: A Photo Viewer Created in OpenGL[^]

Best regards
Espen Harlinn
 
Share this answer
 
v2
Comments
JackDingler 4-May-12 15:25pm    
To clarify, what you need to do is create a simple 2D Mesh that is scaled to fit the client area of your window. For this purpose a single QUAD can do the trick.

You'll select your image into it as a texture.

Then render.

********

So displaying a textured mesh is the kind of sample you want to start with.
I have no tips for DirectX, I've only done this with OpenGL, but the concepts are the same.
Espen Harlinn 4-May-12 15:31pm    
The first article covers the required steps ...
druscelli 7-May-12 5:16am    
For information: I don't need to scale the image, the frame is just to paint as is. Thanks for the informations and the links, I will look at them, thanks.
JackDingler 7-May-12 10:25am    
If you're going to use a graphics accelerated technology, you will be scaling, even it's 1:1.

You're understand better once you have a basic implementation started.
druscelli 7-May-12 6:03am    
Looks like direct2d is just supported on win7 and win2008 server... Do you think could I find a solution supported on winxp?

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