Copy the contents of a hosted Silverlight control

EDIT: Since my original problem was related to my mistake, I will rephrase this question.

Im placing Silverlight in a window inside my C ++ application based on the code found here .

Now I would like to copy the contents of the control into memory in order to use the contents inside my own rendering. The problem is that when I set the “EnableGPUAcceleration” value to true, then BitBlt stops working, all I get is black.

I believe there should theoretically be a way to copy the contents of a Silverlight control with GPU acceleration with its alpha, for example. with something like glReadPixels.

Has anyone figured out how to copy content using the alpha of a Ukrainianless gpu-accelerated Silverlight control?

Another problem is that the window must be visible, and no other window can block it, otherwise I won’t get the corresponding content. I would like the hosting window to be invisible.

A working code example can be found here (although without the actual BitTlt "ting" that I am trying to get to work).

+6
c ++ winapi directx silverlight opengl
source share
2 answers

I'll start exploring this, I have the idea that OpenCL, or perhaps ever since you use Silverlight, DirectCompute can set up a context in which you can have great flexibility.

One way would be to simply perform all the GPU accelerations in one of these languages. In the meantime, I will try to find out if you can use one of them to get the necessary information or other methods.

This link seems to confirm that you will need GPU acceleration for any interactive members.

EDIT:

I think this article may provide some other help in your problem. Essentially, it is about accessing the cache and ensuring the use of the cache. Everything that is set in cached mode will be temporarily saved on the graphics card.

This article also sheds light on issues. Where he talks about hardware rendering, it’s important to note which operations can cause cache problems.

I have to admit that I'm not at all sure about Silverlight, but these types of problems are familiar. Do your best to understand the situation with your code.

+2
source share

Unfortunately, you can not (IMHO).

If you enable acceleration, then all video processing is performed in gpu and displayed using a hardware overlay buffer. therefore not affordable.

The same is true for the print screen function in windows. if you cannot access gpu and extract the pixels you need.

Take a look at the screenshots section here ... http://en.wikipedia.org/wiki/Hardware_overlay

I am new to Silverlight and therefore do not know what is available, but you can extract the data before visualizing it. This may slow down the application though. gpu acceleration is designed to eliminate the limitations of the processor and bandwidth, so anything that gets in the way will slow it down. you can also trigger the tilt bit (DRM) by disabling everything.

DC

-one
source share

All Articles