zoukankan      html  css  js  c++  java
  • 用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)
  • 相关阅读:
    HTML常用标记(完整版)
    理论精讲-教育知识与能力7-第四章 中学生学习心理
    前端面试题总结
    for-in 和for-of循环的区别
    Nginx部署多个vue前端项目
    vue项目PC端如何适配不同分辨率屏幕
    基于Vue的项目打包为移动端app
    js中Date对象
    React Router的Route的使用
    js中数组的sort() 方法
  • 原文地址:https://www.cnblogs.com/szxiaofei14/p/5010367.html
Copyright © 2011-2022 走看看