程序可以显示png格式的图片,但是同样的代码换成jpeg却不能显示网上好像说要添加jpeg库
注:我写的嵌入式应用程序,是要移植到板子上的
请问
1jpeg库从哪里找?可不能可以使用qt安装目录中的库?
2怎么一直jpeg库?只要把库文件拷贝到板子上?拷贝到那个文件夹?还需要设置什么吗?比如环境变量什么的?
JPEG 库移植
------解决方案--------------------
请参看官方原话。说白了你可以把Qt\plugins下的 imageformats 复制到你的可执行文件文件夹。
Deploying Plugins
This document explains how to deploy plugin libraries that Qt or your application should load at runtime. If you use static plugins, then the plugin code is already part of your application executable, and no separate deployment steps are required.
The Plugin Directory
When the application is run, Qt will first treat the application's executable directory as the pluginsbase. For example if the application is in C:\Program Files\MyApp and has a style plugin, Qt will look in C:\Program Files\MyApp\styles. (See QCoreApplication::applicationDirPath() for how to find out where the application's executable is.) Qt will also look in the directory specified by QLibraryInfo::location(QLibraryInfo::PluginsPath), which typically is located in QTDIR/plugins (where QTDIR is the directory where Qt is installed). If you want Qt to look in additional places you can add as many paths as you need with calls to QCoreApplication::addLibraryPath(). And if you want to set your own path or paths you can use QCoreApplication::setLibraryPaths(). You can also use a qt.conf file to override the hard-coded paths that are compiled into the Qt library. For more information, see the Using qt.conf documentation. Yet another possibility is to set the QT_PLUGIN_PATH environment variable before running the application. If set, Qt will look for plugins in the paths (separated by the system path separator) specified in the variable.
------解决方案--------------------
要装FFMPEG和X264等库吧
------解决方案--------------------
在编译Qte的库时,就应该添加对Libjpeg的支持