Set 2d picture control image

I'm making some palette installers for ease of distribution for some libraries I have written. I'm following the example VIs (search the example finder for "palette API").
I'm having some frustration in setting the new palette icon; the icon constant is a 2d picture control but I can't find a way to drop my image into it, and I can't set it programatically as the 2d picture control VIs only allow me to draw shapes into it.
- Cheers, Ed
Solved!
Go to Solution.

In cases like this I often resort to using a transparent classic path as an overlay to catch dropped files.  If you do not plan on interacting with the picture control, it is quite easy.  Otherwise it is just a few more events to control visibility when the mouse enters the VI with the button pressed.
Just run the VI and drag PNG, JPG, or BMP files to the picture control.
Attachments:
DragToPictureControl.vi ‏16 KB

Similar Messages

  • A problem about saving the picture control'image in a child VI.

    i want to use 'export image' method to get a picture control'image,so ,i have a child VI to use method 'export image',and a main VI to using the child VI,but when i run the main VI,there is no image is saved on the disk ,but if i open the child VI'frontpanel,then,i run the main VI,the image is saved on the disk,i want to know the reason why i can not get the image,when i run the main vi without the child 'frontpanel or blockdiagram is opened.
    Solved!
    Go to Solution.
    Attachments:
    child.vi ‏11 KB
    main.vi ‏7 KB

    The behavior that Simon describes is not a hard and fast rule, and the Export Image method used to be a bit of an exception.  It would supposedly update the controls of unopened FPs that used the method.  Reality never quite matched what was described in the documentation if I recall.
    If you pore over the detailed help you discover that this method works fine in SubVIs with some controls and not others.  Look at the characteristic 'Loads the Front Panel Into Memory', for a Picture control it is 'No', for a Waveform Graph, for instance, it is 'Yes'.  Caveat:  Relying on this level of detail to be correct in the LV help is a bit risky.  Best to try it yourself.  Not loading the FP is a good hint that the method is not going to behave in a SubVI.
    As to the problem at hand, a Picture Indicator is an odd choice to me to use this method.  You have VIs in the Picture palette to convert pictures to image data and then export the image data to a PNG or JPG or BMP file directly.  Anything you would draw and then export could be exported directly without drawing.

  • Transparent Picture Control Quirks?

    (cross-posted to LAVA)
    Can anyone explain this?
    A Picture Control that has been painted transparent has a different Erase First behavior in the context menu.
    Regular picture control, dropped right off the palettes:
    Note that the Erase First item is enabled, and checked by default.
    But, if we use the paintbrush to paint the interior of the Picture Control transparent and then bring up the context menu again:
    Note that now Erase First is checked and disabled so it cannot be unchecked.
    But there's more.  If you try to set the Erase First behavior programmatically, LabVIEW doesn't generate an error and seems to accept the setting, but the change isn't reflected in the context menu:
    It also appears that, regardless of the behavior shown, a Picture Control that's been painted transparent ignores all programmatic Erase First settings and behaves as though it's set to Always Erase.  This, in turn, means that if you set a Picture Control's background to transparent, it will always tend to flicker as you draw more stuff to it, unless you take special precautions (like deferring panel updates).
    Why does a transparent-background Picture Control behave differently from a Picture Control with an opaque background?
    Message Edited by Justin J. Goeres on 12-01-2008 02:30 PM

    Since;
    1) Justin is used to the "Dark-side" and
    2)all picture related question interest me
    3) And NI does not answer Q's on LAVA I will help out a bit. The following is what I think Justin wanted us to see,
    Justin J. Goeres wrote:
    (cross-posted to LAVA)
    Can anyone explain this?
    A Picture Control that has been painted transparent has a different Erase First behavior in the context menu.
    Regular picture control, dropped right off the palettes:
    Note that the Erase First item is enabled, and checked by default.
    But, if we use the paintbrush to paint the interior of the Picture Control transparent and then bring up the context menu again:
    Note that now Erase First is checked and disabled so it cannot be unchecked.
    But there's more.  If you try to set the Erase First behavior programmatically, LabVIEW doesn't generate an error and seems to accept the setting, but the change isn't reflected in the context menu:
    It also appears that, regardless of the behavior shown, a Picture Control that's been painted transparent ignores all programmatic Erase First settings and behaves as though it's set to Always Erase.  This, in turn, means that if you set a Picture Control's background to transparent, it will always tend to flicker as you draw more stuff to it, unless you take special precautions (like deferring panel updates).
    Why does a transparent-background Picture Control behave differently from a Picture Control with an opaque background?
    Message Edited by Justin J. Goeres on 12-01-2008 02:30 PM
    Message Edited by Ben on 12-01-2008 04:05 PM (eastern US)
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • 3D Picture Control Orthographic View zoom - Camera Set up?

    I am trying to display two 3D picture controls.  One displays some objects in 3D (Auto Projection: Perspective, Camera Controller: Spherical).  This 3D image works great and I am having no problems with it.  The other Picture Contol is meant to simulate a 2D image of the 3D object, essentially a Plan View.  To do this I made a 3D picture control with a Orthographic view.  I set the camera to view from above (z-axis) and set the target to be positive y-axis. 
    I have attached an example vi (labview 2013 SP1) that creates some simple 3D objects and displays them in Perspective and Orthographic using the same Camera Position.  On initial start, the Orthographic image is zoomed in heavily. If I manually zoom it (Hold Shift button and mouse up or down), then the Orthographic image will set itself to the correct Camera position.  This is essentially the solution to my problem, but I can't assume the user will have the ability to manually zoom the image.  So I need to set it programmatically.
    If you manual adjust the view on either screen (rotate and zoom), then click the Set Camera button, both images will give a plan view, but only the Perspective Image will be at the correct camera zoom or distance.  The Orthographic stays at the last zoom distance.
    Is there any way to set the Camera distance for Orthographic projection programmatically?   I have tried starting with the 3D picture control as perspective, set the camera distance and then changing it to orthographic, but this still results in a zoomed orthographic image.  From the reading I have done, I think I am trying to the impossible.  Does any one have another suggestion to get the same result.  I have previously used the 2D picture functions to generate the image but found that method inefficient. 
    And suggestions would be great.
    Thanks
    Relec
    Attachments:
    3D_projection_Test.vi ‏38 KB

    Hi Relec,
    thank you (and Kudos) for that inspiring demo!
    Took me while to work it out, but I might have found something that could help us with the orthographic projection.
    Sometime back someone posted a way to collect the current Camera data. Sorry I lost the source. But here is my version as a Get3DCameraPosition.vi using the ModelViewMatrix.
    Unfortunatly this doesn't return the current Target and so a bit of guessing in the right Direction is necessary.
    I'm impressed you found a way to make the Shift-Drag Zoom-movement possible on the orthographic window.
    It seems a whole thread at http://forums.ni.com/t5/LabVIEW/3D-Picture-Control-Doesn-t-Zoom-in-Orthographic-Mode/td-p/1544460/page/2 wasn't able to find that out.
    In the meantime I've found a way using the ProjectionMatrix to create a zoom-effect which I build into your demo using the mouse wheel.
    All in all I've tried to translate camera movements from the perspective window in the ortho - assuming this is what you were after?!
    Again the missing target information doesn't make it quite right.
    Regs
      Jannis

  • How do I get picture control to display PNG images with transparent background?

    I have an image of a robot arm looking from the top with a transparent background and saved as PNG. When I drag the image directly to LabVIEW front panel, the image shows properly with the transparent background, but I want to manipulate it such as rotate the image. I used the Read from PNG.vi to read the image to a picture control, but the background isn't transparent anymore. Am I missing something?
    Please help.

    unclebump gets 5 stars for referring you to a document that I wrote. 
    Incidentally, I wrote it years back, for LabVIEW 7.0.  A couple of notes to summarize:
    The picture control doesn't "really" support transparency.  However, the image data type supports masking, and stores the alpha channel, if present in your image data.  So you use the "Create Mask By Alpha.vi" referenced in that document to mask out pixels whose transparency is above a certain level.  It does not support partial transparency.  You could try to implement your own blending algorithm based on the picture control's current pixel values, and the image data's RGB value and transparency value, but it would probably be very slow.
    Also, that VI ships with 8.0 and later.  I don't know if it's on the palettes but it lives here:  vi.lib\picture\picture.llb\Create Mask By Alpha.vi
    Good luck!

  • How do i set the size of 3d picture control

    dear sir,
                I have attached my vi.I have one doubt  ie I have used translate object. vi in my vi to move my picture according to the value set by the y position.This y position indicates depth my object.this is sample object  insteat of i am going to update my underwater vehicle.
    What my problem is when i chnage the y value beyond 200 I can not see my picture.so  how do i set the size of the 3d picture control size.
           I have to see my picture within the 3d picture control eventhough i change the y value between 0-500,how do i solve my problem.
    Another my doubt is how do i show the depth value (ie y value in translate object .vi) in 3d picture control ie while the picture is moving in a 3d picture control at the same time i want to display the corresponding depth rating in the 3d picture control
    Pls anyone suggest me as soon as possible.
    Thanks and regards
    jayanthi.k
    Attachments:
    Untitled 1.llb ‏67 KB

    Jayanth,
    Take a look at the attached example.  Alternatively, you can search for it in NI Example Finder by going to Help>>Find Examples in LabVIEW, click on the search tab, and search for meshes.  I had difficulty reading your code, but I believe you need to position your lighting source in the optimal location to get better definition.  And the example shows how to bind a color to the object.
    Trey B
    Applications Engineering
    National Instruments
    Attachments:
    Using Meshes.vi ‏76 KB

  • Load picture control with png image from the web

    Hi guys,
    Is there an example anywhere for Labview 8.6 for loading a picture control with png image from the web?

    Hi lavalava,
    here you find a note on how to load pictures from the internet. After grabbing the data you could save them to a file, load the file with the picture file functions and then convert it into the image datatype to feed a picture indicator with the data...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Draw image at point in picture control

    Is there a VI for drawing an image at a certain point in a picture control?  Something like the "Draw Text at Point" or "Draw Rectangle" VIs but with an image.

    An example using Unflatten pixmap... redraw the same image after a 50 pixel shift in x and y :
    Message Edité par chilly charly le 11-16-2007 02:00 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Add image.png ‏259 KB

  • How can I Manually Insert an Image into a Picture Control?

    Hi,
            I am able to insert an image programmatically into a picture control. But I want to insert an image into the picture control without any code that is manually. How can I Do that?
    Thanks in Advance
    Regars,
    Malleswari

    malli wrote:
    Hi,
            I am able to insert an image programmatically into a picture control. But I want to insert an image into the picture control without any code that is manually. How can I Do that?
    Thanks in Advance
    Regars,
    Malleswari
     You may also drag and drop a picture directly to your front panel. You can also use paint, or some other tools,  to copy a part of a picture and past it into your front panel. This actually works for the block diagram also. Se example 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    pic example.vi ‏157 KB

  • Move a jpeg image within a picture control

    I am having problems moving a jpeg image inside a picture control with my arrow buttons.
    any help would be great thanks
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Solved!
    Go to Solution.
    Attachments:
    picfun.vi ‏17 KB
    ball.jpg ‏2 KB

    Hi Harold,
    Things are hooked up wrong....
    (Also, you don't really want to read the same file with each repeat. Once is enough! )
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    picfunMOD.vi ‏13 KB

  • How can I set the caption text of picture controls inside an array or how can I choose which array element is assigned using the array elements caption text property.

    I have 8 picture controls inside an array and I would like to set the caption text of these controls.
    I have used the property node of the array and used the array elements property caption text to set the text.
    The problem is however that I set the same text to all the picture controls inside the array.
    My question is how to set caption text of specific elements (Picture control) that I have so far only been able to access using the array elements caption text property.

    Some more help
    1 You could use the caption of the array and place it in front of the selected picture and update that using property nodes.
    2 Like Norbett said if you use a cluster of pictures then their caption can be updated individually.
    Here is a an example that demonstrates the above
    David
    Attachments:
    Modify the Captions Of Pictures.vi ‏83 KB

  • Picture control: stick image to corner

    In a Picture Control, with the option "Stick image to corner" the image is sticked to the upper-left corner of the control.
    Is there a way to select the corner to which the image is sticked (upper-left, bottom-left, upper-right, bottom-right)?
    I've been thinking to this properties because I have some picture controls used as a background images, and I need the background isn't moved when I drag a splitter (see attachment)
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded
    Attachments:
    picture.uir ‏749 KB

    Probably it would have been better if I had posted an uir file that shows the "real" situation of the project I've been working on.
    As a matter of fact my application has a vertical splitter and two horizontal splitters:
    I'd already tried several workarounds but I didn't find a solution for the bottom-right background image.
    In the first post I attached a simple panel, but in this one I attached an uir that shows the issue of my application.
    Is there any workaround for the bottom-right image?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded
    Attachments:
    real_picture.uir ‏2988 KB

  • FP.Get Image not working on a subVI if it has a picture control

    Download the attached (7.0).
    Open and save BOTH VIs in your own version. This is important, because it looks like if the VI is recompiled its FP is loaded into memory and the bug is not apparent.
    Run the VI. The indicators in the subVI are not updated the first time you run the VI.
    This happens in 8.6 as well and requires the subVI to have a picture control and to have its FP closed.
    One workaround is to use the first call? primitive and call the Open FP method (with the state set to hidden) when the VI starts running.
    Try to take over the world!
    Attachments:
    SubVI FP not updating.llb ‏30 KB

    Hey Tst,
    Thank you for the feedback.
    I tried the vi's you have attached here and it updated the first time I ran the Caller.vi.
    I must be doing something different from you.
    Aashish M
    Applications Engineer
    National Instruments
    http://www.ni.com/support/

  • How do I apply a texture to an imported .stl file in 3D Picture Control?

    Hi, I'm trying to apply a 2D image as a texture to an imported .stl file in 3D picture control. It works fine if I'm using a standard shaped mesh created in LabVIEW, however is there a way in which a texture can be applied to an imported model that isn't a standard shape, in my case a balloon. I've attached the an image of the Sub vi where I apply the texture. The object just shows up as a flat colour. Do I need to define how the image is applied to the mesh due to it being a non-standard shape? If so, any pointers would be appreciated.
    Many thanks.
    Oh, I'm using LabVIEW 2009 SP1.
    Attachments:
    stl texture problem.jpg ‏60 KB

    Apologies, been trying all afternoon and then a couple of minutes after posting, I figured it out. Using a property node for the Scenemesh reference, I set the property TextureGenMode to Spherical and it appears to now display the texture on the mesh.

  • 2D picture control doesn't refresh properly

    I have an application which displays a picture in a 2D picture indicator and draws a few rectangles and lines on top of the picture. 
    The locations of these lines change throughout the day, and the application is designed to run minimized and then provide a quick-look at various status items when it is restored by the user.
    While minimized however, the image does not appear to get updated, even though my code is updating it once per second. I can't actually tell what happens when it's minimized obviously, but the behavior persists for some time after the window is restored, and the state it is 'frozen' at is from the time it was minimized.
    There are other digital indicators on the front panel getting updated in the same 1Hz loop, so I know it is just the 2D picture indicator that's not working--i.e., something with LabVIEW or system related is causing the image not to refresh while it's minimized, and more importantly, for some time after the application is restored.
    Some things that will cause a successful refresh to the displayed image after I restore from the task bar to a stale display:
    Minimize again, then restore again (of the LabVIEW window)
    Probing the datapath on the BD for the final Draw Line output that connects to the indicator
    Waiting for awhile (15 seconds? 30 seconds?)
    I also tried setting the following property node with no effect: 
    VI > Panel > Defer Panel Updates > Set to False
    Another way to think about this would be to imagine a 2D picture control with an analog clock, where lines are drawn for minute and hour hands, and updated once per second.  This is not what I'm doing but the example is easy to understand.  When the application is restored from the taskbar, the clock appears frozen in time from the last time it was minimized.
    Same behavior running this in LV 2012 and 2013... I am looking for any other property nodes or refresh methods to force a refresh at 1Hz, regardless if the display is visible.  The display should be immediately up-to-date when the application is restored by the user.
    Solved!
    Go to Solution.

    You could try looking at the panel resize event (to recognize the restoring) and then force an update using one of the following methods (I have no idea if they will help):
    Set defer to T and only then to F.
    Set defer to T when minimizing.
    Set the FP window state to something else (hidden, minimized, etc.) and then to standard. This should ideally do the same thing you did with minimizing and restoring again.
    Use the window position property to place the window off the screen and then back in its original position.
    See if you can toggle the synch. updates property programmatically.
    Have a hidden control displayed over the picture control and then hide it.
    Try to take over the world!

Maybe you are looking for

  • How do I unassociate a device from my Apple ID?

    I installed 7 on my iPad and it was purchased for the wife  but I set it up with my Apple ID and after installing 7 it won't let her download her iTunes purchases says this device is already associated with another Apple ID,Is there a way to unassoci

  • How to suppress n0: default Namespace prefix in Transformations

    Hi, I use Simple Transformations for serialization of deep structured data. In the XML File the whole tree needs to use a special namespace. Therefore i use the attribute xmlns="ABC.de" without a namespace prefix in my root element. During serializat

  • IPhoto not found after OS reinstall and upgrade

    I just bought a used Mac Mini to give to my in-laws. I used the original boot disks to reinstall the software. I then upgraded to Leopard. When all was said and done, evereything was wonderful except that iPhoto was nowhere to be found. Going back to

  • Can I use hotmail with the Mail app?

    I looked at the mail app, but didn't see hotmail in there. Can I use it on the touch after upgrading?

  • To find the size of the fact table and dimension table

    Hi experts, Can anyone plz tell me if i want to find size of the fact table and size of the dimension table to find cardinality and line item do we first build statistics then find size by transaction DB02 or any other method we have? Thanks in advan