Dynamics AX 中的图片处理
|
1.从本地读取图片文件,并判断格式是否附合要求。 FilenameFilter filter = [‘Image Files‘,‘*.bmp;*.jpg;*.gif;*.jpeg‘]; BinData binData = new BinData(); str extention, path, nameOfFile; Container imageContainer ; imageFilePathName = WinAPI::getOpenFileName(element.hWnd(),filter,‘‘, "@SYS53008", ‘‘,‘‘); if (imageFilePathname && WinAPI::fileExists(imageFilePathName)) { [path, nameOfFile, extention] = fileNameSplit(imageFilePathName); if (extention == ‘.jpg‘) { binData.loadFile(imageFilePathName); imageContainer = binData.getData(); } else { throw error("@SYS89176"); } } 2.将AX中的图片保存到本地文件夹 str path; FilenameFilter filter = [‘Image Files‘,‘*.jpg‘]; CompanyImage companyImage; Image image; DialogBox dialogBox; ; path = WinAPI::getSaveFileName(0,filter,‘‘,‘‘,‘‘,‘filename‘,0); if(path) { image = new Image(); image.setData(companyImage.Image); if(WinAPI::fileExists(path)) { dialogBox = new DialogBox(DialogBoxType::YesNoBox,strfmt("@HPH243",path),‘‘,‘‘,DialogButton::Yes); if(DialogButton::Yes == dialogBox.retval()) image.saveImage(path); } else { image.saveImage(path); } } 3.图片缩放显示在控件上。 image = new Image(); image.setData(imageContainer); w = image.width()*sel/100; h = image.height()*sel/100; image.resize(w,h,InterpolationMode::InterpolationModeDefault); Photo.image(image); //Photo为bitmap控件 4.图片的剪切,显示图片的控件窗口不能被其他窗口遮挡。 Container rect; rect = WINAPI::getWindowRect(this.hWnd());//获取图片控件的屏幕坐标 int left,top; left = conpeek(rect,1); top = conpeek(rect,2); image = new Image(); image.captureScreen(left,top,width,height);//根据坐标和大小进行剪切,该方法同样可以用来进行屏幕截图 5.导出图片到指定文件夹,适用于批量图片导出。 str path; Image image; str filename = "test.jpg"; image = new Image(); image.setData(imageContainer ); path = WinAPI::browseForPath(element.hWnd(),‘‘); if(substr(path ,strlen(path)-1,1)!="\\") path+="\\";//如果选择的桌面,则要加上\ path += filename; image.saveImage(path); 附加: 获取用户选中的多条记录,以EmplTable为例: for(emp=EmplTable_ds.getFirst(1) EmplTable_ds.getFirst(1):EmplTable_ds.cursor();emp;emp=EmplTable_ds.getNext()) { //do something } |
Dynamics AX 中的图片处理的更多相关文章
- Dynamics AX 中重点数据源方法
数据源方法 描述 Active 当用户刚选中一行数据时执行该方法.若选中的是主表的数据,也用该方法来触发加载从表符合条件的数据.主要覆盖该方法来根据条件设置记录及其字段是否可见或是否可被编辑. ...
- Dynamics AX 2012 在BI分析中建立数据仓库的必要性
AX系统已有的BI分析架构 对于AX 的BI分析架构,相信大家都了解,可以看Reinhard之前的译文[译]Dynamics AX 2012 R2 BI系列-分析的架构 . AX 的BI分析架构的优势 ...
- Dynamics 365新特性介绍:在视图中显示图片和提示
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复242或者20161230可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...
- Dynamics AX 2012 R2 SSRS报表在VS2010中预览没有数据
今天,Reinhard 在VS中制作SSRS报表,预览的时候发现显示不出数据. 仔细检查了数据处理环节和临时表里的数据,都发现没有问题. 用同事的账号登陆同样的开发环境,发现他的账号可以在VS中预览到 ...
- Dynamics AX 2012 R2 在AIF服务契约中使用DateTime
Reinhard在AIF中使用DateTime作为服务契约的参数,与DotNet程序进行交互时,总是因为时区的问题,导致DotNet提交的System.DateTime与AIF中接收的DateTime ...
- Dynamics AX 2012 的工业物联网解决方案
Dynamics AX 2012 的工业物联网解决方案 物联网 物联网的概念在这两年非常火,包括近期很火的共享单车初创公司--摩拜单车,在产品中运用了Azure Iot物联网技术.但是,物联网并不是一 ...
- Dynamics AX 2012 R2 业务系列-销售业务流程
在博文Dynamics AX R2 业务系列中,Reinhard对这个系列做了一个规划,下面我们就按照规划开始说业务吧. 1.销售的主要职责 其实这里说的职责主要是针对销售文员,并非整天外面满世界跑业 ...
- [译]Dynamics AX 2012 R2 BI系列-规划分析的注意事项
https://msdn.microsoft.com/en-us/library/gg731898.aspx 在开始实施AX的分析特性前,有很多事情要考虑.本文描述了你必须考虑的事情,和在 ...
- Dynamics AX 2012 R2 安装Reporting Services 扩展
今天Reinhard在VS中部署SSRS报表时,接到以下错误: 部署因错误而被取消.在报表服务器上,验证:-SQL Server Reporting Services 服务是否正在运行. 接着,Rei ...
随机推荐
- java.lang.OutOfMemoryError: PermGen space解决方法
- Maven 下载、安装、配置学习
一.Maven 下载与安装 电脑已安装:JDK.Eclipse 1.下载Maven:http://maven.apache.org/download.cgi 2.解压并安装:解压路径名不能有中文! 3 ...
- LeetCode 102. Binary Tree Level Order Traversal 二叉树的层次遍历 C++
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...
- Zabbix11.3 Zabbix SNMP 常用OID列表
点击获取CISCO设备OID 系统参数(1.3.6.1.2.1.1) OID 描述 备注 请求方式 .1.3.6.1.2.1.1.1.0 获取系统基本信息 SysDesc GET .1.3.6.1.2 ...
- File和FileStream的区别
File和FileStream的区别直观点:File是一个静态类:FileStream是一个非静态类.File:是一个文件的类,对文件进行操作.其内部封装了对文件的各种操作(MSDN:提供用于创建.复 ...
- spring boot 2.0.4 Redis缓存配置
spring boot 2 使用RedisTemplate操作redis存取对象时,需要先进行序列化操作 import org.springframework.cache.CacheManager; ...
- Spring 获取bean 几种方式
转载自: http://www.cnblogs.com/luoluoshidafu/p/5659574.html 1.读取xml文件的方式,这种在初学入门的时候比较适用 . ApplicationCo ...
- python学习Day5 几种数据类型的使用
今日内容 数据类型分类: int | complex | float | str | bool | list | dict | tuple | set 3种数据类型的方法:(数字.字符串.列表 ) 可 ...
- 2019 AI CITY CHALLENGE
官网: https://www.aicitychallenge.org/ 基于来自交通,信号系统,基础设施和运输的传感器数据,存在使运输系统更智能的巨大机会.不幸的是,由于几个原因,进展受到限制 ...
- 使用 Spring Data 进行 MongoDB 4.0 事务处理
使用 Spring Data 进行 MongoDB 4.0 事务处理 原文链接:http://spring.io/blog/2018/06/28/hands-on-mongodb-4-0-transa ...