请问怎么样可以在labwindows cvi里自动保存图像,就是不用弹出个选项框让你选择保存路径?

虽然FileSelectPopup能实现保存图像,但是会弹出个框,我需要的是在算法中就能设定保存路径,只要按保存控件就能自动帮我保存好。有没有这样的算法呀?谢谢!... 虽然FileSelectPopup能实现保存图像,但是会弹出个框,我需要的是在算法中就能设定保存路径,只要按保存控件就能自动帮我保存好。有没有这样的算法呀?谢谢! 展开
 我来答
朴忆辰j3
2011-11-14 · 超过28用户采纳过TA的回答
知道答主
回答量:87
采纳率:0%
帮助的人:52.2万
展开全部
你是要保存整个Panel的图像。还是要保存部分图像?
如果要保存整个Panel用
SavePanelDisplayToFile
int SavePanelDisplayToFile (int panelHandle, int scope, Rect area, int newHeight, int newWidth, const char path[]);

Purpose
Creates a bitmap "snapshot" of the specified panel, scales it according to the newHeight and newWidth parameters, and then saves it to file.

Parameters
Input
Name Type Description
panelHandle integer The specifier for a particular panel that is currently in memory.

This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function.
scope integer Specifies whether to use the visible area or the full panel for the bitmap created from the panel display.
area Rect Use this parameter to restrict the area of the panel scaled and copied into the bitmap.

You must pass a Rect structure. The rectangle coordinates, specified in pixels, are relative to the upper–left corner of the panel (directly below the title bar) before the panel is scaled.

Use the VAL_ENTIRE_OBJECT macro if you do not want to restrict the area scaled and copied.
newHeight integer If you pass VAL_ENTIRE_OBJECT for the area parameter, this parameter specifies the desired height of the resultant bitmap. (If you want to maintain the same height, pass –1.)

Otherwise, the resultant height equals

(new height/initial height) × area height
newWidth integer If you pass VAL_ENTIRE_OBJECT for the area parameter, this parameter specifies the desired width of the resultant bitmap. (If you want to maintain the same width, pass –1.)

Otherwise, the resultant width equals

(new width/initial width) × area width
path const char [] The pathname of a file. If it is not an absolute pathname, the pathname is relative to the current working directory.

Return Value
Name Type Description
status integer Returns 0 if the function succeeded or a negative error code if the function failed.

The possible negative error codes are:

–1 to –999 A User Interface Library error code. (Constants are available in userint.h.)

You can call the GetGeneralErrorString function in the toolbox.fp instrument driver to obtain a description of any of these error codes.

注:path就是你要保存的位置。这个可以实现不跳出对话框的。
这个函数我用过,不知道能不能帮上你。
cvi里头有很多函数。你可以在>>help>>contents 里面搜索下。
追问
我要保存的图像就是自己开辟的那个单元,主要是不能自动化,我要先把拍下来的图像保存在指定路径然后要对他进行处理。而现在的要求是点一下拍照就能自动保存图像在已经指定的路径,而不用每次按拍照都会弹个框出来问你保存在那里,还要按一下保存才帮你保存。主要是这个问题,谢谢啦!
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式