Resizing a picture of structure within a DLL using the memory manager

Hi all

I dug deep inside the rooms, but has failed to find a solution to my problem.

I am building a dll, which made a few imageprocessing and must return an array of structures to labview, with a struct for each element of the image.

Because I do not know the number of items in advance and at the limit of the number is a number of magnitude higher than expected, I don't want to allocate such a huge part of memory before the dll call in labview.

In an older version, I used a table 2d for the elements, where each line contains the values of each element. Here I used the function NumericArrayResize, which worked very well. But I have to add several subprocesses and using structs (or clusters in labview) seems to be more useful and more clean to me, I had also some items back and Foreword climb several times.

For example, a struct element must take 2 single beds and 1 uint32. My question now is, how can I resize this table of struct with memory manager, functions as the NumericArrayResize functions is not suitable for this purpose?

(Access to an array of structures inside the DLL and after reading the changed values in Labview is surprisingly easy )

Thanks in advance

Well, I was able to solve it myself. I found this thread, where the first rolfk post made me think. It seems to me that the numericarrayresize function behaves very similar to the function realloc of c. so I used the unsigned int type 8 (which is just a byte) and multiplied by the number of bytes used by a struct, in my case 12 bytes (4 + 4 + 4) and multiplied it by the number of structures (elements of the image) I. Fortunately, it worked and the block of memory has been resized, exactly as I wanted it to be. Important note: do not forget to adjust the size of the handle element, otherwise Labview does not know the size has changed.

Tags: NI Software

Similar Questions

  • I just installed lihtroom CC and develop, the picture is blue. When I used the front then the image before is normal and blue again after.

    I just installed lihtroom CC and to develop the module, the picture is blue. When I used the front after, the before image is normal and the after looks always blue.

    I don't know what to do?

    See link below:

    https://forums.Adobe.com/thread/1823307

    6 Lightroom displays a blank blue screen with an X through it in the module development for all my photos

  • CVI DLL using the reminders of Message Windows

    Background:

    I had a CVI wound around a third-party DLL executable application.  Recently, I've built a few LabView modules and wanted to use the features in the code of the CVI.  I deleted as much as I can from the code of the CVI and built a DLL out of it, so now that it's a call to a third party DLL DLL of CVI.  The third-party DLL uses windows messaging to communicate with the CVI DLL.  I wanted not to re - write the functions already developed in CVI in LabView (much too much effort).

    Problem:

    The problem is windows messaging in CVI uses the InstallWinMsgCallback and binds it to a group of experts.  The events are not processed until you call RunUserInterface(). RunUserInterface does not return. Therefore, any LabView module that loads this DLL crashes, waiting for the DLL back.

    Does anyone develop a CVI DLL, which uses internal reminders, which can be called from an external process?   Anyone have any ideas on how to get around?

    Daniel,

    In fact, I came across the solution even before that you posted.  One thing I noticed however was that it was a little unpredictable when the message would be received.  It turns out that defining the InstallWinMsgCallback to intercept that in_queue worked without needing a processsystem looping events.

    -Bryan

  • Simultaneous access to a DLL using the JNA

    Hello

    I'm working on a Java project where I use JNA to load a library (.dll) that implements several functions for a VME bus. The project works well, without any other application requiring access to the VMEbus (ie using the same dll). However, the project that I am is supposed to be launched with the other applications that use the same dll. In this case, it seems that the FMV locks the dll file, and then other applications no longer work because they cannot access the dll.
    The JVM wants exclusive access to the DLL, but of course that he will never go. How can I get my program to access the dll of simultaneously with other applications without locking?
    I already looked in the java security policy and the Security Manager, but no idea at all, so any help would be appreciated.

    Thank you very much

    Kind regards

    Alexander

    Lahdhal wrote:
    Assuming this is true, there is a point that I still don't understand: how the operating system can grant (read) access to the dll several programs in C++, but it cannot load the dll for java programs and c ++ both ? Is a conflict between java and c ++ at the same time trying to load the same library as possible?

    Because programming is difficult, computers are far from perfect and the operating system doing its best in this imperfect environment.

    Instead of trying to blame the technology (which will be don't get you anywhere), think about it for a minute. Which can be a difference between C++ and Java applications? I can cite one that is likely, but I can't know for sure that this is the case due to a lack of information from you:

    -your C++ applications bind to the DLL at the time of Assembly (IE. you include a lib in your project)
    -Java binds to the DLL at runtime using LoadLibrary

    I'm not saying that it is a possible cause, I just try to open your eyes a little. There are things to discover. To be read on the operating system with the dll works until you can actually find. But whatever you do, stop blaming technology.

  • Hi everyone, Im fairly new to photoshop.   Can question, I extend the width of a picture beyond its original size by using the clone tool or other tools?

    When I learn how to add pictures here, I'll do.

    Thank you

    Suzanne

    suzanneck wrote:

    When I learn how to add pictures here, I'll do.

    Thank you

    Suzanne

    Hi Suzanne

    It would certainly help if you put the image up on the forum.   Right click and choose copy, and then paste this topic with ctrl v (v Cmd)

    There are different ways to fill the extra canvas when you added it.  Content Aware Fill is good, but it depends on the content of the original image, to stick it the image here for the best advice.

  • VulcanControl.dll is missing. I deleted the apps, reinstalled, used the removal tools, and still can not use the extension manager for Dreamweaver, etc...

    If it can't be fixed Im moving to another company.as software it takes much too long and I've tried everything on the forums.

    Hi davidp67009702,

    Please refer to this thread vulcancontrol.dll missing, could be of great help to solve this problem.

    Kind regards

    Nicos

  • Is it possible to create a Qt Widgets within After Effects using the SDK?

    Hello

    I would like to use Qt to create dialogs and widgets inside AfterEffects.

    I started with the Panelator sample in the SDK. I can include QtGui in the project, but as soon as I create any object with QObject as a base class After Effects immediately crashes with the following error: '[...] "could not be loaded (48::46)"

    When I try to delay load QtCore.dll and QtGui.dll, I can at least start the plugin and see, that the accident occurred in the initializer of QObject.

    I use

    VS 2010

    QT 4.8.5

    and my buildenvironment is x 64

    I was wondering if there is some sort of incompatibility of incorporation Qt into After Effects (due to the compiler/linker configuration or sets or something like that).

    It is the output of the debugger:

    Inhabitants:

    locals.PNG

    Discussions:

    threads1.PNG

    My code of the Panel-constructor function:

    int argc = 0;

    char * argv [1] = {""};

    QApplication * a = new QApplication (argc, argv); ERROR GETTING PRODUCT IN THIS LINE. for a test, I traded it to QWidget * w = new QWidget(); and sometimes as well.

    QWidget * w = new QWidget();

    w-> show();

    one-> exec();

    Beyond the works AfterFX Qt fine and I also can defer loading QtCore and QtGui.

    If someone of you has already experience in the use of QT in AfterEffects, I would greatly appreciate your help!

    Thanks in advance.

    I've heard a similar problen with QtWidgets in a different context, and that the only solution was to connect the Qt libraries statically.

    Another short in the dark: try putting the dll Qt somewhere in the path (if they aren't already) or to the folder where the "After Effects.exe', because I remember, there could be situations where the"current"Directory isn't the plugin but the source of the host folder.

  • How can I change the parameters of the actions within a function using the different function

    Can not think of another way to ask, I have looked EVERYWHERE and tried to do my best of my knowledge, but no luck.
    Suppose I got 10 squares respectfully named sq1, sq2... sq10 and I have a 10 button that, when you press on, calls a function that makes his respectful place move and changes color. This would be a problem if she had only 10 squares and just do 2 actions, simply change the name of the instance of each function... something like:

    Button1.onPress = movesquare1 ();

    Button2.onPress = movesquare2();

    ... and so on

    function movesquare1 ();

    SQ1._x = sq._x + 1;

    function movesquare2 ();

    SQ2._x = sq._x + 1;

    ... and so on

    is it possible to have a function General movesquare, designate a variable N so that when a button is pressed the N variable would be designated?

    something like:

    Button1.onPress = movesquare (n = 1)

    function movesquare ();

    SQN._x = sqn._x + 1;

    This way I don't that the change in n = 1 so that it points to the right sq and that avoiding wrote MANY movesquare functions for each sq...

    Long post but I tried to explain my dilemma it the best way possible.

    Tried to use var: String and var: number but no luck...

    Thank you very much

    You can make use of notation of support use of target objects string values.  First think in terms of pass a number to such function as shown below...

    Button1.onPress = function() {movesquare("1")};

    Button2.onPress = function() {movesquare("2")};

    function movesquare (num) {}

    This ["sq" num] ._x plus sq._x + 1;

    }

  • How to get the value of a component within a Repeater using the identifier of the component?

    Hello I am on a Repeater with a httpservice as dataprovider.

    in this relay, I have a < mx:Panel > that contains a < mx:Text > < mx:ButtonBar > and < mx:HSlider >.

    I need to get the text property of the text element and the value of the HSlider when changed the slider value. (using the "change =... ("my HSlider property).

    How to do what I need to know what Panel, HSlider, and whose text has been activated by the change of cursor?

    Thanks for your help

    This could help you.

    
    
    
    
      
        
       
    
      
          
          
      
    
    
  • Resize a picture does change the dimensions?

    original title: resize Photo Gallery

    resize a picture really does change the deminsions of the photo, as of 4 "x 6" to 3.5 "x 5", or is it simply adjust the resolution? "

    The size is resolution / pixels horizontally and vertically.

    Also known as crop or zoom in on a certain place on a photo.

    Resizing to compress the entire file, while retaining the proportions,

    Resize in wl Photo Gallery is not an exact science, it gives references waves to the dimensions that you posted almost useless.

    First of all, I would like to ask what you are trying to do and why?

    Microsoft Paint has better / more accurate way to resize the files.

    Which can be done by the percentage of the existing file or Pixel sizes, which is most useful if you need an exact pixel size for avatars...

    http://Windows.Microsoft.com/en-us/Windows7/using-paint

    I personally use the image manager of office for these types of changes.

  • DLL with the same screws simultaneously

    Hello

    I have two DLLs that have the same names of VI compiled. Now, I have the problem, that I can not use the two DLLs at the same time. It seems that the VI of the first called dll is loaded into memory, and the second dll uses the screw of the first dll - given that the screws have the same name.

    How to avoid this failure? The only way seems to be to rename all the subVIs in the dll, so that they have a unique name.

    Or is there another possibility?

    concerning

    MB

    You can try putting each set of two different libraries (*.lvlib) int SubVIs. If delimeted names stored in the DLL, then you will be able to load the screws with the same names in memory at the same time without conflict.

    Andrey.

  • pointer to the structure within a structure in LabVIEW

    I have not used the library feature LabVIEW call very often, so I quickly found myself on a problem that may, or may not, be easy to solve (for someone in C code).

    Calling a dll that requires a pointer to structure as input. This I can provide by creating a cluster and using "Adapt to the Type" for the dll call input terminal. It passes a pointer to the cluster (structure) of the dll. However, the structure is supposed to contain pointers to other structures.  So now I'm stuck because I don't know how to create LabVIEW clusters that contain pointers to other poles of LabVIEW.

    Is it still possible?

    In the source file, the definition of the structure looks like this:

    typedef struct DmtxEncode_struct {}
    int method;
    the int schema;
    int sizeIdxRequest;
    int marginSize;
    int moduleSize;
    int pixelPacking;
    int imageFlip;
    int rowPadBytes;
    DmtxMessage * message;<-- pointer="" to="" another="">

    DmtxImage * image;<-- pointer="" to="" another="">
    DmtxRegion region;
    DmtxMatrix3 xfrm;

    DmtxMatrix3 rxfrm;

    } DmtxEncode;

    My own experience with it is limited, but a pointer is basically just a number that represents an address in memory (a number of 32-bit in a 32-bit system).

    Depending on the function you call what with the pointer, you might be OK with him giving even a null pointer, but because you have no way to know with certainty what the function does, or will in the future, you should give the correct pointer.

    How do you do that? Well, you need get the pointer to the relevant structure and for that you will need to allocate the structure. If the DLL you are using has a function that allocates memory for the structure and returns a pointer to it, you're in luck - take this pointer and put it in the cluster. If it doesn't have such a function, I think you need to write and compile a c yourself.

    That said, others with more experience could have a simpler solution.

  • How can I resize a picture using Picture Manager please?

    How can I resize picture using Picture Manager please? Let's say I want to put 4 x 6 cm for a given photo dimensions. I tried to resize , but is it compresses the picture to send by e-mail etc... It is basically a photo compressor.

    How can I resize picture using Picture Manager please? Let's say I want to put 4 x 6 cm for a given photo dimensions. I tried to resize , but is it compresses the picture to send by e-mail etc... It is basically a photo compressor.

    =============================
    If you are running Windows XP... it is a free software
    The PowerToy that is useful for resizing of the pictures:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Go to the following link and download and
    install: ImageResizer.exe
    http://www.Microsoft.com/windowsxp/downloads/PowerToys/xppowertoys.mspx
    (does not work on Vista)

    Then, you can open any folder containing
    images and you will have an option to resize.
    Just right click the selected image files and
    Choose resize images in the menu. You
    can select a picture or an entire group.

    The program will place the resized in copies
    the folder with your originals.
    (Tip: * never * overwrite your originals)

    To ensure that images in both portrait and
    landscape orientation are resized to the
    same dimensions... go to... Advanced...
    and enter the largest number in these two areas.
    IOW... for 600 x 800... Enter 800 in these two areas.

    (Tip: even if you resize the Photos to the same)
    dimensions (original)... the file size will be greatly
    reduced).

    =====

    If you want to change the proportions of a picture...
    you have to reframe it... otherwise it will be distorted.

    The following freeware has a tool of good harvest.
    Just select a thumbnail and press X to open the
    Council for culture. (Tip: always save your editing / cropped /)
    photos resized under a new name)

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    FastStone Image Viewer
    http://www.FastStone.org/FSViewerDetail.htm

    The following tutorial provides information on the creation of a
    2 "x 2" photo ID, but the steps would be
    basically the same for any size.

    Now, open the program and select (highlight)
    the image you want to change.

    According to... to... Edit / crop Panel (or type... (X)

    Click on the button 'Set Ratios of paper'.
    (it's just to the right of the proportion of paper
    fall of window)

    Click on the 'Add' button and enter... 2 x 2 "
    Click on... OK / OKAY... (this will give you the square
    format you need)

    You can resize the selection frame by dragging
    reposition by dragging corner handles
    the arrow of the 4 channels. At the end... Click on the 'culture '.
    button.

    Now... to... File / save as...
    Choose a backup location, enter a new name for
    the photo and choose a format to save in...
    Left click on the Save"" button.

    =====

    Info about photo manager
    If you resize a photo with Picture Manager and
    save it when you see the dialog box saying:

    "There are changes that have not been saved"

    The original photo will be overwritten (replaced)
    with the rezized version... IOW the original will
    be unrecoverable.

    To keep two versions of the picture, resize it
    and go... File / save as... Enter a new name for
    version resized and on the left, click on the "Save" button.

    When you close the photo manager and see the
    dialog box:

    "There are changes that have not been saved"

    On the left, click the do not save"" button. Now
    have both versions.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How can I place several smaller images of varying size on one page for printing without losing the original size.  Board contact option to resize my pictures

    Does anyone know how to place several small pictures on a single page, so I can print them out as a rather print over and over again.  I want to maintain the original size of the images that vary somewhat.  I tried to use the option of the Board-contact, but he seems to want to resize my images which unfortunately is of no use to me.  I tried to cut and paste on a new page, but I don't think that it is now the original size.

    Alternative applications sometimes can provide quick and easy results.

    It might be interesting to download the demo version of Photoline: it includes a simple Board-contact option that allows for images to be included without loss of resolution, i.e. the original is left intact and the proportions remain unchanged. Since Photoline also supports documents several pages, all the thumbnails are collected into rows and columns, the user can control and the end result can be exported as PDF.

    -Download the trial of pl32.com

    -Open Photoline, then open the browser (CTRL/CMD (B)

    -Navigate to your folder with the images you want to combine for printing.

    -right mouse click in the thumbnail view, and then select "Create image Catalog.

    -Select the page by Page size

    -under 'Size' define the number of rows and columns (there are here a translation error: "Spalten (COL) / rows (lines)".)

    -Uncheck "scale photos physically." This ensures that the original images are intact and incorporated in full resolution.

    And then click OK.

    Some of the other testing devices until you get a satisfactory result. Then export it to PDF.

  • Hi, I would like to add an image in my video for 2 seconds, then only within a framework of the video running (to cover some part of the picture in video for 2 seconds. Is it possible to do?

    I would like to add a photo in my video for 2 seconds, then only within a framework of the video running (to cover some part of the picture in video for 2 seconds. Is it possible to do?

    Just add your photo on a higher video track, it will cover up to a below. You can use the effects of movement to move and scale the image.

Maybe you are looking for

  • THE BUTTON SHAPE FLICKER AFTER UPDATE 9.3.4

    When I update iOS 9.3.4 can open when emails and go to inbox with tab button "return" upper (LEFT scale) is sparkling with little other icon square why? This only occurs in the email otherwise button icon works fine without twinkle in all other optio

  • Update graphics ATI catalyst on Satellite Pro A300

    Is it possible to update the graphics card ATI Catalyst or the drivers for my graphics card? Today, I got a notice that something is wrong with MMLoadDrv.exe (sorry I don't remember exactly what he said) and that the update will solve the problem. I

  • IMicrosoft 'Repair disc' has 'uninitialized' my external hard drive

    will have a problem of audio distortion and hit 'Repair disc' for my external hard drive, thinking it could be the culprit.  The program at a standstill.  When I rebooted, my external hard drive would not appear on my computer.  In disk management, i

  • BlackBerry Smartphones Outlook 2007 and troubled synchronization schedule

    As a help to those of you who have experienced the total frustration of sync Outlook 2007 tries to date with your BB - I was able to understand what was going on with mine, and maybe this will help others: I found that appointments which not WERE DO

  • El Capitan - Adobe CS5 Suite - is compatible OSX?

    Sir or Madam, sitis the new version of my MAC, called OSX El Capitan, compatible with Adobe CS5 Suite (Photoshop, Dreamweaver, Illustrator, InDesign ETC.)?Yours sincerelyPatrick Weinbrecht