
C++ 是用GDI的Image和Graphics画图怎么判断图片是否存在
Graphicsgraphics(hdc);WCHAR*filepathw=fullname.AllocSysString();Imageimage(filepathw,...
Graphics graphics(hdc);
WCHAR* filepathw=fullname.AllocSysString();
Image image(filepathw, FALSE);
graphics.DrawImage(&image,x,y);
代码大概就是这样。我要做到如果图片存在返回true,不存在返回false。怎么判断呢? 展开
WCHAR* filepathw=fullname.AllocSysString();
Image image(filepathw, FALSE);
graphics.DrawImage(&image,x,y);
代码大概就是这样。我要做到如果图片存在返回true,不存在返回false。怎么判断呢? 展开
展开全部
Image x = image(filepathw, FALSE);检查x是不是NULL就行了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询