用pb打开i图片

用pb的setPicture居然报

JPEG Processing Error
---------------------------
Image too wide for this implementation

的错误,于是想是否有其他的办法,百度了一下有如下两种容易的方法

(1)用Windows 图片和传真查看器打开图片
run("rundll32.exe shimgvw.dll,ImageView_Fullscreen " + "c:\a.jpg")

 

(2)用默认图片查看程序打开图片

  C/C++ code

  //声明API Function Long ShellExecute(Long hwindow, String lpOperation, String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) Library 'shell32.dll' Alias for 'ShellExecuteA' //调用 ShellExecute(handle(this), '', "c:\a.jpg", '','', 1) 

 

  C/C++ code

  string ls_path, ls_file int li_rc ls_path = '\\192.168.1.200\项目\图片' li_rc = GetFileSaveName ( "Select File", & ls_path, ls_file, "jpg", & "All Files (*.*),*.*" , "", & 32770) IF li_rc = 1 Then ls_path //返回的文件完整路径名(含文件名) ls_file //返回的文件名(不含路径) End If

/*PB中的声明与调用*/
Function long ShellExecuteA (long hwnd, string lpOperation ,String lpFile, String lpParameters, String lpDirectory, Long nShowCmd)  Library "shell32.dll"

/*也可以*/
FUNCTION Long ShellExecute ( Long hwnd, String lpOperation, String lpFile, String lpParameters, String lpDirectory, Long nShowCmd ) LIBRARY "shell32.dll" ALIAS FOR "ShellExecuteA"

/*调用*/

shellexecutea(handle(this), "open", ls_picture_path, "","", 1)

 

posted @ 2015-12-01 15:57  春夏秋冬春  阅读(1279)  评论(0编辑  收藏  举报