LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Picture constant creation

Solved!
Go to solution

In the attached vi, there are 2 pictures.

 

The bridge is the sample, the sine wave is my own.

 

Using the sample, can create a constant still with the bridge. Using my own picture, can only create a blank constant.

 

Is there any difference, thanks.

0 Kudos
Message 1 of 10
(6,260 Views)
The picture indicator that you created is actually empty.  With pictures, what you see is not necessarily what you get.  In this instance you were most likely drawing with 'Erase First' unselected.  The last thing you wired to the picture was probably an empty picture which became its contents.  It just happens that the indicator "remembers" what was previously drawn.  When you build a picture from multiple pieces you should either use concatenate strings or a shift register if you want the contents of the indicator to represent what is shown.
Message 2 of 10
(6,253 Views)
Solution
Accepted by topic author alex.
Can you explain a little more what you are trying to do?
Message 3 of 10
(6,252 Views)

Actually I just want to create a picture constant having the sine wave.

 

The sample picture can do it, but mine cannot.

 

What I trying to do is customize the picture in advance and import the sine picture.

 

Any suggestion? Thanks.

0 Kudos
Message 4 of 10
(6,223 Views)
'Erase First' is all the time selected.
0 Kudos
Message 5 of 10
(6,221 Views)
How did you get the sine image into the picture control and have you made any modifications?
0 Kudos
Message 6 of 10
(6,188 Views)
Using the draw picture vi.
0 Kudos
Message 7 of 10
(6,172 Views)

I don't get what's going on here.

 

For all intents and purposes, the indicator seems to be empty.  The blank constant seems to be empty.  Looking at the data, it appears to be an image that has no pixels.

 

Yet your picture shows the blue sine wave on a black background which seems to be what you are trying to create.  Copying picture indicators, changing them to controls, wiring things to each other, dropping empty picture constants.  The only way I get that particular image is if I make a copy of your picture indicator.  No amount of programming seems to modify it other than having a real picture get wired into it.

 

It is almost like your picture indicator is actually an empty picture, but has an image saved as its background image.  Resizing the indicator causes that image to scale with it.  While if you resize an indicator with a real picture, the image doesn't scale but basically crops.

 

Where did you get this picture indicator from?  Where is the "Draw Picture VI" you are referring to?

Message 8 of 10
(6,161 Views)

I had two theories, either he customized the control and imported the picture or he copied the indicator and didn't set the default value.  Once I resized the control and saw the image scale I figured it was the former.  As you can see I have tried to get a few details with limited success.

 

To recreate what I did for the bridge:

 

Read from PNG file -> Draw Flattened Pixmap -> Right-click on indicator and 'Create Constant'

 

To see a customized control, see the attachment 

Message 9 of 10
(6,156 Views)

Yes that is it.

 

The control was customized.  I was thinking that at first, but when I went into the control editor, nothing jumped out at me.

 

After reading your post, I went in and played some more.  Clicking on the wrench broke up the control into its parts.  The picture part (which I dragged out of its frame to make clearer what was going on) can be changed by right clicking on that and selecting import from file.  Close out the control, save it to file or not, but have the changes update the VI.

 

Now the default empty image of that control is the new picture that was imported rather than the plain, white background.

Message 10 of 10
(6,151 Views)