Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好,我正在编写类似 .xps 查看器的代码。xps 文件的结构包含代表形状(fe 三角形)的对象,然后进入其中。对象代表图像。示例结构是
<canvas shape="...."> <path src="a.jpg"/> <path src="b.jpg"/> </canvas>
我想绘制这两个图像,但仅在受其父节点(画布)限制的区域内,我将图像转换为位图。画布形状由一组点表示。我将在directx中绘制这个。感谢您的建议,Przemek
您可以为此使用模板缓冲区。
首先,在模板缓冲区中绘制画布的形状(将值设置为 1)。然后将设置更改为仅在模板值等于 1 的位置绘制并绘制其他形状。最后,清除模板缓冲区以供进一步使用。