07-04-2012 10:47 AM - edited 07-04-2012 10:48 AM
Hello all,
I have been trying to develop some remote desktop application which is integrated with my main project. I have managed to develop one but it uses ".NET screen capture" that takes time and uses a lot of processor. I have searched and found that using DirectX is the fastest way to capture screen. There is not any Labview code but C# code exists.
A third party library, named SlimDX, is used. It is free and can install SDK just in a few minutes. C# code works fine and really fast. I tried to convert this code to Labview. Used .NET calls but I meet parameter error and couldn't find what is wrong.
Snippet is at below
Does anyone correct the problem or is there any code to share about capture screen with DirectX?
Thanks for help.
07-04-2012 11:56 AM
Haven't checked all but to the first parameter to the Device() constructur method, the C# code passes a valid Direct3D object created with new() not just a static reference. So you will have to use a constructure or something to create such an object too.
07-05-2012 04:17 AM
Thanks for the tip. I have searched references a bit more and found the constructor.
Now I am stuck at taking the data to Labview. Everything else seems fine. Do you have any idea how I can get the image to LV?
Thanks for helping.
07-05-2012 07:40 AM
I worked a bit and solved importing the picture to LV.
This is the way to capture screen using DirectX. It is really fast but converting image takes time.
You have to install SlimDX SDK to use .NET calls.
Anyone find a better way please add the solution 🙂
07-12-2012 04:09 PM
02-20-2013 03:44 PM
hello 🙂
I'm doing a school project where I need to take screen captures, but the copy-paste with the keyboard is too slow. So your code is exactly what I would need but I just started using .net in labview, and I can't manage to reproduce it 😕 could you post your vi please? it would really helpful..
Thank you! 🙂
02-20-2013 04:14 PM
You won't believe it but the image in the last post from Zafer is in fact a VI snipped. Just drag it to your desktop and from there into a LabVIEW diagram and watch the magic happen!
02-21-2013 11:56 AM
i didn't know that, thank you! 🙂
06-10-2015 06:11 AM
Hi,
I am trying to do this thing but after installation of Slimdx whenever I am trying open the vi, it becomes unsuccessful to open/find the Slimdx.dll. Where do I find Slimdx.dll? It is not in my system32 folder. But I have installed it.
06-10-2015 06:25 AM
Well, which LabVIEW version and platform and which Windows?
I assume you run Windows 7 64 bit and LabVIEW 32 bit.
In that case the system32 folder is irrelevant since it contains only 64 bit components. In addition the SlimDX application is a .Net library and .Net components don't get installed into the <system> folder anyhow.
Also depending on your LabVIEW version you have to use either the .Net 2.0 or .Net 4.0 version of the libraries, unless you create a manifest file for your LabVIEW system to load the other .Net framwork version on launch. LabVIEW before 2013 starts up with .Net 2.0 compatibility and after that with .Net 4.0.