Jump to content

Need Help for making an image drop down menu


Recommended Posts

I want to creat a drop down menu which user can select a picture among different pictures. I am wondering how can i put pictures insted of words in a drop down menu? I would appreciate if you could give me your advise.

Attached file is the image of drop menu i want to create in labview.

post-18013-068819800 1282329852_thumb.jp

Link to comment

I want to creat a drop down menu which user can select a picture among different pictures. I am wondering how can i put pictures insted of words in a drop down menu? I would appreciate if you could give me your advise.

Attached file is the image of drop menu i want to create in labview.

have you concidered using a Picture Ring?

Ben

Link to comment

Yes, I tried picture Ring ,but the issue is that the items(images) are changed one by one and i couldn't make it like what it is shown in attached image ( all images are visible and user can select one among them)

You were probably clicking the increment/decrement (up/down) arrows for the ring control. Just try clicking on the picture itself. You will get a thumbnail of each picture and you can select the one you want.

If you're expecting it to look like the picture you posted, i think you'll be disappointed. If you want that, you'll have to do a bit more work with either a picture control (not picture ring) or an XControl. If you're on Windows, you might also be able to find an ActiveX or .Net control that would work.

-Scott

  • Like 1
Link to comment

You were probably clicking the increment/decrement (up/down) arrows for the ring control. Just try clicking on the picture itself. You will get a thumbnail of each picture and you can select the one you want.

If you're expecting it to look like the picture you posted, i think you'll be disappointed. If you want that, you'll have to do a bit more work with either a picture control (not picture ring) or an XControl. If you're on Windows, you might also be able to find an ActiveX or .Net control that would work.

-Scott

[/quote

Thanks Scott. yes by clicking on the every picture it shows all pictures in very small scale and in hozizental direction which is quite different from what i need.

Also do you know why it is not possible to change numeric indicator's size VERTICALLY? It only could be resized horizentally!!!

Farid

Link to comment
  • 4 weeks later...

Regarding my last question, I could make the picture drop down using "pict ring", but what i exactly need to make is a combined drop down menu showing in my sample file.i am confused how to make it. Does anybody know how i can make it? i attach the new sample file

post-18013-086333600 1284497603_thumb.jp

Edited by Farid2010
Link to comment
  • 2 weeks later...

I have a feeling that what you are trying to do is more advanced than what your experience can handle. However, this is how we all learn right?

An XControl won't help you. An XControl is just a nice package. You still have to figure out how to do what you want. Once you figure that out, you can then create an XControl out of it if you want, but not necessary.

I could probably implement what you want in pure LabVIEW using 2 picture controls and some other tricks, so it's definitely doable. But it's not something you can do in 5 minutes.

I suggest you study up on picture controls.

Another consideration is that you might want to change your design. You can probably use an array of picture controls which allows you to scroll through the images. Then when you hover over the one image you can overlay another array of images slightly shifted to the right.

Many creative ways to do this but not easy.

Link to comment

The problem is we are pretty much stuck with the controls we are given. As we don't have access to the control canvas and the "OnRedraw" event, we cannot change the control (with the exception of a few cosmetics). Everything we do to get around it is really a kludge and not for the faint of heart.

You are probably better off finding an Active X or .NET control tat supports images and using that.

Link to comment

Thank you guys. as michael said i have not that much experience but i m trying to either make my project and also learn labview. it's hard but i ma really interested . I have to read more about xcontol and picture controls.

The problem is we are pretty much stuck with the controls we are given. As we don't have access to the control canvas and the "OnRedraw" event, we cannot change the control (with the exception of a few cosmetics). Everything we do to get around it is really a kludge and not for the faint of heart.

You are probably better off finding an Active X or .NET control tat supports images and using that.

Link to comment

Thank you guys. as michael said i have not that much experience but i m trying to either make my project and also learn labview. it's hard but i ma really interested . I have to read more about xcontol and picture controls.

This won't do the cascading effect, but you can have a quick look at how you could use a simple array of pictures with events to act as a drop-down picture ring.

PictRing.vi

  • Like 1
Link to comment

I tried again but still when i browse to select a directory which contains my pictures,either in non-executing mode and executing mode! it does not select the directory. could u double check the file yo sent me? Thanks

Select the directory before running the VI.

You can check on startup (init frame) and add a browse for directory primitive from the File IO palette.

Link to comment

I tried again but still when i browse to select a directory which contains my pictures,either in non-executing mode and executing mode! it does not select the directory. could u double check the file yo sent me? Thanks

Did you have any PNG files in the directory? You can change it in the code if you use other formats. Also, I've limited it to the four first file in the folder for the demo, but you can change that in the code.

I've changed the code to ask for the folder on startup.

<a href="http://content.screencast.com/users/normandinf/folders/Jing/media/6fa447b3-276b-484f-a496-3d3f10261a04/2010-10-01_0905.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/6fa447b3-276b-484f-a496-3d3f10261a04/2010-10-01_0905.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/6fa447b3-276b-484f-a496-3d3f10261a04/2010-10-01_0905.png" width="306" height="284" border="0" /></a>

PictRing.vi

Link to comment

Yes I have png files. I tried the new file you just sent. again the same problem. As you see in the image, when i select the folder which contains png files nothing is selected in "file name" section. it doesn't select neither by selecting and hiting open button nor by double click or etc.!!!

Did you have any PNG files in the directory? You can change it in the code if you use other formats. Also, I've limited it to the four first file in the folder for the demo, but you can change that in the code.

I've changed the code to ask for the folder on startup.

<a href="http://content.screencast.com/users/normandinf/folders/Jing/media/6fa447b3-276b-484f-a496-3d3f10261a04/2010-10-01_0905.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/6fa447b3-276b-484f-a496-3d3f10261a04/2010-10-01_0905.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/6fa447b3-276b-484f-a496-3d3f10261a04/2010-10-01_0905.png" width="306" height="284" border="0" /></a>

PictRing.vi

post-18013-038442600 1285939484_thumb.pn

Link to comment

Yes I have png files. I tried the new file you just sent. again the same problem. As you see in the image, when i select the folder which contains png files nothing is selected in "file name" section. it doesn't select neither by selecting and hiting open button nor by double click or etc.!!!

Browse to the folder that contains a list of your images (the usual double-clicks to open the folder). When you see the png files listed, select "Current Folder" at the bottom right.

<object id="scPlayer" class="embeddedObject" width="634" height="478" type="application/x-shockwave-flash" data="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/jingh264player.swf" >

<param name="movie" value="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/jingh264player.swf" />

<param name="quality" value="high" />

<param name="bgcolor" value="#FFFFFF" />

<param name="flashVars" value="thumb=http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/FirstFrame.jpg&containerwidth=634&containerheight=478&content=http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/2010-10-01_0941.mp4&blurover=false" />

<param name="allowFullScreen" value="true" />

<param name="scale" value="showall" />

<param name="allowScriptAccess" value="always" />

<param name="base" value="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/" />

<video width="634" height="478" controls="controls"><br />

<source src="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/2010-10-01_0941.mp4" type="video/mp4;" /><br />

<b>Your browser cannot play this video. <a href="http://www.screencast.com/handlers/redirect.ashx?target=viewingembededhelp">Learn how to fix this</a>.</b>

</video>

</object>

Link to comment

Froncois!Thank you so much for your kind effort. I did exatly what you showed in video. Now it shows this error message after selecting "current folder". I don't know what is wrong!!!!

Browse to the folder that contains a list of your images (the usual double-clicks to open the folder). When you see the png files listed, select "Current Folder" at the bottom right.

<object id="scPlayer" class="embeddedObject" width="634" height="478" type="application/x-shockwave-flash" data="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/jingh264player.swf" >

<param name="movie" value="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/jingh264player.swf" />

<param name="quality" value="high" />

<param name="bgcolor" value="#FFFFFF" />

<param name="flashVars" value="thumb=http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/FirstFrame.jpg&containerwidth=634&containerheight=478&content=http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/2010-10-01_0941.mp4&blurover=false" />

<param name="allowFullScreen" value="true" />

<param name="scale" value="showall" />

<param name="allowScriptAccess" value="always" />

<param name="base" value="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/" />

<video width="634" height="478" controls="controls"><br />

<source src="http://content.screencast.com/users/normandinf/folders/Jing/media/41ae1109-54db-438b-b200-e462ec7e9383/2010-10-01_0941.mp4" type="video/mp4;" /><br />

<b>Your browser cannot play this video. <a href="http://www.screencast.com/handlers/redirect.ashx?target=viewingembededhelp">Learn how to fix this</a>.</b>

</video>

</object>

post-18013-022072900 1285941095_thumb.pn

Link to comment

it does'nt show any error!! but still no picture is shown. here is the image with highlighting execution.

As I thought... if PNG's are actually not corrupted.

Let's try something else:

Can you check where the error is occuring in the code?

It works fine in my place, so we've got to find the point where the error is generated. Use execution highlighting.

post-18013-039641200 1285967286_thumb.pn

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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