没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:况鱼杰|2019-09-02 14:48:46.707|阅读 354 次
概述:本系列教程整理了VectorDraw Developer Framework(VDF)最常见问题,教程整理的很齐全,非常适合新手学习,本节教程将会介绍如何在VDF中发挥透明度的作用。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
VectorDraw Developer Framework(VDF)是一个用于应用程序可视化的图形引擎库。有了VDF提供的功能,您可以轻松地创建、编辑、管理、输出、输入和打印2D和3D图形文件。
VectorDraw Developer Framework试用版下载
问:
透明度如何在VDF中发挥作用?
答:
在版本6023中,我们为vdFigure对象添加了一个名为TransparencyMethod的新属性。此属性从vdFigure.TransparencyMethodEnum获取值,如下所示:
| TransparencyMethodEnum.ByLayer | 该对象采用透明度(AlphaBlending值)的颜色为图层pencolor AlphaBlending。 |
| TransparencyMethodEnum.ByBlock | 该对象获取所有者的颜色透明度(AlphaBlending值)。所有者是一个带有AlphaBlending笔颜的vdInsert。 |
| TransparencyMethodEnum.Default默认值 | 如果对象是真彩色,则对象将获得自己的透明度值。如果笔触是索引,则使用调色板的颜色透明度值。 |
| TransparencyMethodEnum.KeepOwn | 该对象总是采用它自己的pencolor透明度(AlphaBlending值)。 |
除此属性外,还有Solid2dTransparency属性,该属性仅应用于阴影线/填充对象,并且仅应用于2D(线)模式,而不应用于3D(Wire3d / Shade / Hide / ShadeOn / Render)模式。因此,如果您希望填充的对象仅在2D而不是3D中透明,则可以使用此属性。
另一方面,如果您希望对象在3D和2D模式下透明,则需要使用TransparencyMethod属性并将AlphaBlending值设置为vdFigure (KeepOwn,Default)或vdLayer(ByLayer)或parent(vdBlock)。AlphaBlending将值从0(完全透明,如不可见)取值到255(根本不透明)。
本方法适用于版本6.6023.x及更高版本,因为以前的6023版本中不存在用于vdFigure的TransparencyMethod。
下面的代码将向您演示对象的透明度如何在VDF中工作:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
vdDocument doc;
private void Form1_Load(object sender, EventArgs e)
{
doc = vdFramedControl1.BaseControl.ActiveDocument;
}
private void button1_Click(object sender, EventArgs e)
{
//Transparency of vdCurves (line, polyline etc).
// For better display of this transparency a thicker line type is used in the code
doc.New();
vdRect rect = new vdRect(doc, new gPoint(0, 0, -0.1), 10, 2, 0);
rect.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);
doc.Model.Entities.AddItem(rect); // this is added just for better transparency display
// Using the transparency in the object by setting the AlphaBlending
vdCircle cir1 = new vdCircle(doc, new gPoint(2, 2), 1.0d);
cir1.LineWeight = VdConstLineWeight.LW_211;
cir1.PenColor.ColorIndex = 2;
cir1.PenColor.AlphaBlending = 120;
// the PenColor.AlphaBlending will be applied
cir1.TransparencyMethod = vdFigure.TransparencyMethodEnum.KeepOwn;
doc.Model.Entities.AddItem(cir1);
// Using the transparency in the Layer
vdLayer lay = new vdLayer(doc, "Transparent");
lay.PenColor.FromSystemColor(Color.Red); // layer is red !!!
lay.PenColor.AlphaBlending = 120; // setting layer's transparency
doc.Layers.AddItem(lay);
vdCircle cir2 = new vdCircle(doc, new gPoint(4.7, 2), 1.2d);
cir2.LineWeight = VdConstLineWeight.LW_200;
cir2.Layer = lay;
cir2.PenColor.ColorIndex = 2;
// but object is not colored by layer, only transparency is by layer here
// Layer's alpha blending wil be applied
cir2.TransparencyMethod = vdFigure.TransparencyMethodEnum.ByLayer;
doc.Model.Entities.AddItem(cir2);
// Using the transparency inside blocks/inserts
vdBlock blk = new vdBlock(doc, "Transparecy");
vdCircle cir3 = new vdCircle(doc, new gPoint(8, 2, 0), 1.5); // bigger circle
cir3.PenColor.ColorIndex = 2;
cir3.LineWeight = VdConstLineWeight.LW_158;
// the insert's Aplha blending will be applied
cir3.TransparencyMethod = vdFigure.TransparencyMethodEnum.ByBlock;
blk.Entities.AddItem(cir3);
cir3 = new vdCircle(doc, new gPoint(8, 2, 0), 0.7); //smaller circle
cir3.PenColor.ByBlock = true;
cir3.LineWeight = VdConstLineWeight.LW_158;
// the layer's Aplha blending will be applied which isn't transparent
cir3.TransparencyMethod = vdFigure.TransparencyMethodEnum.ByLayer;
blk.Entities.AddItem(cir3);
doc.Blocks.AddItem(blk);
vdInsert ins = new vdInsert(doc, blk, new gPoint(0, 0, 0), 0, 1, 1, 1);
// setting the inserts draw to use the Alpha Blending
ins.TransparencyMethod = vdFigure.TransparencyMethodEnum.Default;
ins.PenColor.FromSystemColor(Color.Yellow);
ins.PenColor.AlphaBlending = 120; // setting transparency to 120
doc.Model.Entities.AddItem(ins);
doc.Model.ZoomExtents(); doc.Redraw(true);
}
private void button2_Click(object sender, EventArgs e)
{
// Hatches/Filled objects and Transparency
doc.New();
vdRect rect = new vdRect(doc, new gPoint(0, 0, -0.1), 10, 2, 0);
rect.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);
doc.Model.Entities.AddItem(rect); // this is added just for better transparency display
// 2D Transparency Does NOT work in 3D modes (hide/shade/render/wire3D)
vdCircle cir1 = new vdCircle(doc, new gPoint(2, 2), 1.0d);
cir1.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);
cir1.HatchProperties.Solid2dTransparency = 80; // values 0 (invisible) to 255 (no transparency)
cir1.PenColor.FromSystemColor(Color.Red);
cir1.HatchProperties.FillColor.FromSystemColor(Color.Green);
doc.Model.Entities.AddItem(cir1);
// Transparency in PenColor work ALSO in 3D modes (hide/shade/render/wire3D)
vdCircle cir2 = new vdCircle(doc, new gPoint(4.7, 2), 1.2d);
cir2.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);
cir2.PenColor.FromSystemColor(Color.Green);
cir2.HatchProperties.FillColor.FromSystemColor(Color.Red);
cir2.HatchProperties.FillColor.AlphaBlending = 80;// values 0 (invisible) to 255 (no transparency)
doc.Model.Entities.AddItem(cir2);
// the above modes can be compbined with TransparencyMethod of vdfigure (that work in 3D modes), like
vdCircle cir3 = new vdCircle(doc, new gPoint(8, 2, 0), 1.5);
cir3.PenColor.ColorIndex = 4;
cir3.LineWeight = VdConstLineWeight.LW_200;
cir3.PenColor.AlphaBlending = 80;
cir3.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);
cir3.HatchProperties.FillColor.FromSystemColor(Color.Green);
cir3.HatchProperties.FillColor.AlphaBlending = 80;
cir3.TransparencyMethod = vdFigure.TransparencyMethodEnum.KeepOwn;
doc.Model.Entities.AddItem(cir3);
doc.Model.ZoomExtents(); doc.Redraw(true);
}
}相关资料推荐:
VectorDraw Developer Framework(VDF)示例
如果您对想要购买正版授权VectorDraw Developer Framework(VDF),可以联系咨询相关问题。
关注慧聚IT微信公众号 ☟☟☟,了解产品的最新动态及最新资讯。

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@ke049m.cn
文章转载自:



大型SaaS系统的自动化测试常常受制于界面变化快、结构复杂、加载机制多变等因素。从元素识别到脚本管理,SmartBear TestComplete帮助Salesforce建了可靠的自动化测试体系。
BarTender 标签管理系统,正是帮助企业轻松实现 GS1 标准化标签设计、编码生成与信息联动的强大工具。
Parasoft C/C++test 是一款功能强大的 C/C++ 软件测试工具,集成了静态代码分析、单元测试、集成测试和覆盖率分析等功能,单元测试作为其关键功能之一,为了适配多样化的目标部署环境,C/C++test 设计了灵活的测试结果收集机制。通过Socket通讯方式来收集单元测试结果,从而扩展其测试覆盖范围与应用场景。
Parasoft C/C++test作为一款功能全面的自动化代码质量保障工具,为C/C++开发者提供了静态分析、单元测试和运行时错误检测等核心功能。通过将其与轻量级且广受欢迎的VScode编辑器集成,开发团队可以在熟悉的编码环境中实时获得代码质量反馈,有效提升开发效率与代码可靠性。
相关产品
将常用工程图文件转换为新的VectorDraw格式标准,以及其他文件格式。
VectorDraw Developer Framework (All in one)面向对象的矢量图形引擎库,支持2D和3D图形,用于可视化其应用程序,无限分发授权。
VectorDraw web library (javascript)基于HTML5的矢量图引擎,100%采用Javascript编写,无客户端插件也可在浏览器中编辑你的矢量图形。
最新文章 MORE
半岛外围网上直营相关的文章 MORE
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@ke049m.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
半岛外围网上直营