VectorDraw Developer Framework(VDF)是一个用于应用程序可视化的图形引擎库。有了VDF提供的功能,您可以轻松地创建、编辑、管理、输出、输入和打印2D和3D图形文件。
问:
如果只允许从我的应用程序中打开并保存一些特定的文件类型。例如vdml / vdcl和png文件。怎样才能做到这一点 ?
答:
您需要使用OnGetSaveFileFilterFormat和OnGetOpenFileFilterFormat事件并添加如下代码:
void ActiveDocument_OnGetSaveFileFilterFormat(ref string saveFilter) { string versions = ""; saveFilter = ""; saveFilter += "VDML (*.vdml)|*.vdml|"; versions += "?VDML"; saveFilter += "vdcl (*.vdcl)|*.vdcl|"; versions += "?VDCL"; saveFilter += "PNG (*.png)|*.png|"; versions += "?PNG"; saveFilter += "|"; saveFilter += versions; } void ActiveDocument_OnGetOpenFileFilterFormat(ref string openFilter) { openFilter = "All Drawing Files (*.vdml;*.vdcl;*.png;)|*.vdml;*.vdcl;*.png;"; openFilter += "|VDML Document (*.vdml)|*.vdml"; //add VDML openFilter += "|vdcl Document (*.vdcl)|*.vdcl"; //add VDCL openFilter += "|PNG Files (*.PNG)|*.PNG"; // add PNG openFilter += "|All Files(*.*)|*.*||"; }