exe显示不出图片

handsome boy! 2018-10-16 02:05:15
我用图形界面库写了一个控制台程序,在vs2013上面运行正常的,但是我到文件夹运行exe文件就只能显示文字显示不出图片了,有没有哪位大佬能指导一下我啊,很头疼,网上搜了很多都没找到想要的解决方法
...全文
423 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
@风轻云淡_ 2018-10-17
  • 打赏
  • 举报
回复
你在集成IDE中运行有图片是因为使用的是你配置的路径,你直接双击exe他就找不到图片的路径了,解决办法,在程序中的图片添加全路径,或者把图片相对于main.cpp的位置,复制到exe下面即可。
handsome boy! 2018-10-17
  • 打赏
  • 举报
回复
引用 2 楼 sevancheng的回复:
应该是图片路径问题,图片放在exe 所在文件夹试试
问题解决了,谢谢,就是把图片和exe放到一个文件夹里面就好了
sevancheng 2018-10-16
  • 打赏
  • 举报
回复
应该是图片路径问题,图片放在exe 所在文件夹试试
赵4老师 2018-10-16
  • 打赏
  • 举报
回复
_fullpath, _wfullpath
Create an absolute or full path name for the specified relative path name.

char *_fullpath( char *absPath, const char *relPath, size_t maxLength );

wchar_t *_wfullpath( wchar_t *absPath, const wchar_t *relPath, size_t maxLength );

Function Required Header Compatibility
_fullpath <stdlib.h> Win 95, Win NT
_wfullpath <stdlib.h> or <wchar.h> Win NT


For additional compatibility information, see Compatibility in the Introduction.

Libraries

LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version


Return Value

Each of these functions returns a pointer to a buffer containing the absolute path name (absPath). If there is an error (for example, if the value passed in relPath includes a drive letter that is not valid or cannot be found, or if the length of the created absolute path name (absPath) is greater than maxLength) the function returns NULL.

Parameters

absPath

Pointer to a buffer containing the absolute or full path name

relPath

Relative path name

maxLength

Maximum length of the absolute path name buffer (absPath). This length is in bytes for _fullpath but in wide characters (wchar_t) for _wfullpath.

Remarks

The _fullpath function expands the relative path name in relPath to its fully qualified or “absolute” path, and stores this name in absPath. A relative path name specifies a path to another location from the current location (such as the current working directory: “.”). An absolute path name is the expansion of a relative path name that states the entire path required to reach the desired location from the root of the filesystem. Unlike _makepath, _fullpath can be used to obtain the absolute path name for relative paths (relPath) that include “./” or “../” in their names.

For example, to use C run-time routines, the application must include the header files that contain the declarations for the routines. Each header file include statement references the location of the file in a relative manner (from the application’s working directory):

#include <stdlib.h>

when the absolute path (actual file system location) of the file may be:

\\machine\shareName\msvcSrc\crt\headerFiles\stdlib.h

_fullpath automatically handles multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the multibyte code page currently in use. _wfullpath is a wide-character version of _fullpath; the string arguments to _wfullpath are wide-character strings. _wfullpath and _fullpath behave identically except that _wfullpath does not handle multibyte-character strings.

Generic-Text Routine Mappings

TCHAR.H Routine _UNICODE & _MBCS Not Defined _MBCS Defined _UNICODE Defined
_tfullpath _fullpath _fullpath _wfullpath


If the absPath buffer is NULL, _fullpath calls malloc to allocate a buffer of size _MAX_PATH and ignores the maxLength argument. It is the caller’s responsibility to deallocate this buffer (using free) as appropriate. If the relPath argument specifies a disk drive, the current directory of this drive is combined with the path.

Example

/* FULLPATH.C: This program demonstrates how _fullpath
* creates a full path from a partial path.
*/

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <direct.h>

char full[_MAX_PATH], part[_MAX_PATH];

void main( void )
{
while( 1 )
{
printf( "Enter partial path or ENTER to quit: " );
gets( part );
if( part[0] == 0 )
break;

if( _fullpath( full, part, _MAX_PATH ) != NULL )
printf( "Full path is: %s\n", full );
else
printf( "Invalid path\n" );
}
}


File Handling Routines

See Also _getcwd, _getdcwd, _makepath, _splitpath
软件介绍:可随意截图,不管是手机上显示的还是手机摄像头里看到的,更可录像(将你在手机上玩的游戏录下来分享给好友-可谓是众乐乐啊)本软件支持USB_蓝牙_WIFI 塞班相关信息http://bbs.dospy.com/thread-5086709-1-193-4.html 安装说明:先安装Pc端_mobiola_webcam_3_0_11.exe文件后安装Webcam_v3.0.11汉化.exe会提示覆盖,点确定。 再安装手机端_webcam_s60_v_3_0.sis(此文件需你自签名!) 而后把手机和电脑用USB数据线(或蓝牙_WIFI)连接,首先打开手机端Mobiola Web Camera for S60软件,然后打开电脑端Mobiola Web Camera for S60软件,这时电脑右下方的Mobiola Web Camera for S60小图标会有一条红杠,在软件右方选择USB,然后选择端口。(端口的查看-我的电脑-右键-管理-设备管理器-端口里查找你的手机端口是哪一个)如果还是分别不出那可在电脑端Mobiola Web Camera for S60软件里一个一个试,选择好后红扛会消失,表示连接成功 在手机Mobiola Web Camera for S60介面上有两个介面,一个是cam 1和Screen。请在cam 1介面下点-选择-connect-USB 点确定。这时就会自动连接。连接成功后电脑端Mobiola Web Camera for S60软件会显示出你的手机摄像头拍摄出的情景,也可通过它截取你手机上显示的所有内容(图片格式),录像也不在话下!一个字-强... 注明:开这软件要先开手机端,再开电脑端。如果中间你关了视频,那么要把电脑端的关掉,先把手机端打开再开电脑端。支持QQ、MSN等所有聊天视频等... ____如果觉得好用 也请多关照本店(淘宝店铺:http://shop68388423.taobao.com/)软件陆续更新中____

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧