简体   繁体   English

打开窗口选择图像C ++

[英]open window to choose images c++

I am using c++ in ubuntu 12.04 using gcc. 我正在使用gcc在ubuntu 12.04中使用c ++。 Am trying to perform few image processing tasks using opencv. 我正在尝试使用opencv执行一些图像处理任务。 For this, I want the user to select an image. 为此,我希望用户选择一个图像。 Is it possible to open the directory explorer through c++, and let user choose the image, by selecting folders or drives, etc.? 是否可以通过c ++打开目录浏览器,并允许用户通过选择文件夹或驱动器等来选择映像? I actually did not know how to google this question exactly, my apologies if this is pretty rudimentary. 我实际上不知道如何确切地用谷歌搜索这个问题,如果这很简单,我深表歉意。 Your help is much appreciated. 非常感谢您的帮助。 Thanks in advance 提前致谢

You will want to use a GUI toolkit like Qt . 您将要使用Qt之类的GUI工具箱。 They ususally have some sort of function for what you want. 它们通常具有您想要的某种功能。 In the case of Qt the QFileDialog would be good. 对于Qt, QFileDialog会很好。

For learning Qt: There are official tutorials or maybe this question . 对于学习Qt:有官方教程,也可能有这个问题

If you want to go down this route you can also use a completely separate program just for getting a file name. 如果您想走这条路,还可以使用一个完全独立的程序来获取文件名。 Something like zenity maybe. 也许像zenity之类的东西。 Which platform do you want to do this on? 您要在哪个平台上执行此操作?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM