Jump to content

dadreamer

Members
  • Posts

    350
  • Joined

  • Last visited

  • Days Won

    34

Posts posted by dadreamer

  1. Looks to me like some headers conflict... Try to #include "pch.h" as the first header file (before any other headers). Also you may remove all that C:\Program Files\... stuff from the #include directives and leave header names only, as you already specified cintools path in the project settings. If that doesn't help, disable precompiled headers to see, what happens.

    Besides, those %28 and %29 characters on your screenshots look odd to me, because I had not noticed before that Visual Studio escapes some symbols in path names. Do they get added automatically?

  2. 18 minutes ago, alvise said:

    You mentioned earlier a method that can be done without using callback. What method is this?

    Callback is still needed. I said that PostLVUserEvent call may be omitted.

    On 5/27/2022 at 5:00 PM, dadreamer said:

    There exists an easier callback variation, that doesn't involve calling PostLVUserEvent.

    If you don't know C even at very basic level and can't compile DLLs, I'm afraid I can't help here. There are many example on making C/C++ DLLs on the net. My advice is to learn them carefully and only after that go to callback things.

  3. 27 minutes ago, alvise said:

    It must always have two images on the screen and the Picturebox must always be in the middle of the screen, right?

    Since BitBlt is used, your PictureBox object should be visible and on screen completely, because when it's not, then black areas are captured. PrintWindow on the other side should deal with (partially) hidden windows better, but I have no idea why it doesn't work in your case.

  4. There exists an easier callback variation, that doesn't involve calling PostLVUserEvent. I have used it few times in the projects with VLC video streaming from several cameras. It's an asynchronous method too, but it works for sure. The main point is that on the diagram we call DSNewPtr and pass new pointer to the library. When the callback is called, it just writes data by that pointer. In LabVIEW we just read the data by the pointer constantly and process it, if necessary. It's good for common video translation or for simple image processing, when not each video frame is required. Still needs the DLL to be written/compiled though.

  5. 3 hours ago, Rolf Kalbermatter said:

    Doesn't matter. The SDK draws asynchonously into the Picture Box window. No matter which window handle you use, the moment you cause the screen capture from the window handle to occur is totally and completely asynchronous to the drawing of the SDK. And there is a high chance that the screen capture operations BitBlit() or PrintWindow() will capture parts of two different images drawn (blitted into the window) by the SDK function.

    I meant this part:

    image.png.0ca1697625027e333ffa6b7273ff980b.png.0ac882a5b2475fe59c68c2abe32b9ec9.png

    It just makes no sense to capture Empty.vi window and a little sense to capture the whole main VI window, when a concrete .NET window region is wanted. Ok, when drawn onto Empty.vi panel, the whole window must be captured.

  6. I'm not a big fan of Get Image method, because it has a whole load of disadvantages:

    • runs in UI thread only;
    • requires a front panel to be open (and visible to reflect the changes);
    • redraws an image after the control modified it (i.e., scaling, cropping etc.), so if you have the original image of 1024*1280 pixels and it's rendered into the control of 10x10 pixels, you'll get those 10x10 pixels instead;
    • draws control's label/caption additionally (sometimes it's wanted, sometimes not);
    • doesn't work for some third party ActiveX/.NET controls (maybe, because they all use different rendering techniques);
    • sometimes lags / doesn't capture the image.

    When it goes to capturing the window contents by its HWND, I prefer this self-written VI (based on WinAPI calls).

    Get Image By HWND.rar

    And I'm using it that way.

    2015-06-11_19-06-06.jpg.14a345225352dd9217aebf9316caffec.jpg

    Maybe in alvise's case it will suit as well - the chances are slim, but real. 🙂

    Note also: the CLFN's in Get Image By HWND.vi are set to UI thread now, but it's safe to set them to any thread, if desired.

  7. Ok, try then to replace this NULL Handle check with another one shown here: https://forums.ni.com/t5/LabVIEW/How-to-extract-image-from-VLC-active-x-to-LabVIEW-image-JPEG-or/m-p/4117244#M1187715 Take a look at the condition below "Check to see if the Image passed in exists." comment. If that also is of no help, then you need to search for another way of getting the image (say, save a snapshot to the drive first and read out the file second).

  8. 28 minutes ago, alvise said:

    Any ideas what to do now in this situation?

    Your diagram still doesn't look like I'd like to see it.

    - You read the image in frame named "1", whereas it should be named "1.." (with two dots after 1), that means "greater than or equal to 1"

    - The other frame should be named as "..0" or "0, Default", that means it will proceed values other than positive ones.

    Do you receive the same error message after these modifications?

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.